From a52ec5fcb0c86eab39d756cf96d748a1861bd014 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Wed, 8 Nov 2023 23:03:41 +1100 Subject: [PATCH 01/10] Update for newer doxygen. --- asio/boostify.pl | 1 + asio/src/doc/reference.dox | 265 +++++++++++++++------ asio/src/doc/reference.xsl | 462 +++++++++++++++++++------------------ asio/src/doc/tutorial.dox | 251 +++++++++++++++----- 4 files changed, 623 insertions(+), 356 deletions(-) diff --git a/asio/boostify.pl b/asio/boostify.pl index 1af08cece6..74c6c17fab 100755 --- a/asio/boostify.pl +++ b/asio/boostify.pl @@ -160,6 +160,7 @@ sub copy_source_file $line =~ s/changes made in each release/changes made in each Boost release/g; $line =~ s/\[\$/[\$boost_asio\//g; $line =~ s/\[@\.\.\/src\/examples/[\@boost_asio\/example/g; + $line =~ s/asio\//boost\/asio\//g if $is_xsl; $line =~ s/include\/asio/boost\/asio/g; $line =~ s/\^asio/^boost\/asio/g; $line =~ s/namespaceasio/namespaceboost_1_1asio/g; diff --git a/asio/src/doc/reference.dox b/asio/src/doc/reference.dox index 149a3db9ea..d56207d34c 100644 --- a/asio/src/doc/reference.dox +++ b/asio/src/doc/reference.dox @@ -1,43 +1,71 @@ -# Doxyfile 1.4.5 +# Doxyfile 1.9.8 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "Asio Reference" -PROJECT_NUMBER = +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +CREATE_SUBDIRS_LEVEL = 8 +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = YES STRIP_FROM_PATH = ./../../include/ -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +JAVADOC_BANNER = NO +QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = YES -DETAILS_AT_TOP = YES +PYTHON_DOCSTRING = YES INHERIT_DOCS = NO SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 2 -ALIASES = +ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_SLICE = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +TOC_INCLUDE_HEADINGS = 5 +MARKDOWN_ID_STYLE = DOXYGEN +AUTOLINK_SUPPORT = YES BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 +NUM_PROC_THREADS = 1 +TIMESTAMP = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES +EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PACKAGE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES HIDE_FRIEND_COMPOUNDS = NO @@ -45,32 +73,46 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES SHOW_INCLUDE_FILES = NO +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO INLINE_INFO = NO SORT_MEMBER_DOCS = NO SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO GENERATE_TODOLIST = NO GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST= NO -ENABLED_SECTIONS = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = NO -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES WARN_NO_PARAMDOC = NO +WARN_IF_UNDOC_ENUM_VAL = NO +WARN_AS_ERROR = NO WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +WARN_LINE_FORMAT = "at line $line of file $file" +WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ./../../include/asio.hpp \ ./../../include/asio \ @@ -86,118 +128,188 @@ INPUT = ./../../include/asio.hpp \ ./model_dox.txt \ ./noncopyable_dox.txt \ ./std_exception_dox.txt -FILE_PATTERNS = +INPUT_ENCODING = UTF-8 +INPUT_FILE_ENCODING = +FILE_PATTERNS = RECURSIVE = NO -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = YES -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +FORTRAN_COMMENT_AFTER = 72 #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 1 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = NO HTML_OUTPUT = . HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE = AUTO_LIGHT +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_CODE_FOLDING = YES +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDURL = +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO +CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO +SITEMAP_URL = +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 1 GENERATE_TREEVIEW = NO +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 1 TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +HTML_FORMULA_FORMAT = png +FORMULA_FONTSIZE = 10 +FORMULA_MACROFILE = +USE_MATHJAX = NO +MATHJAX_VERSION = MathJax_2 +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = NO +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex +LATEX_MAKEINDEX_CMD = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO +LATEX_BIB_STYLE = plain +LATEX_EMOJI_DIRECTORY = #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = YES XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = NO +XML_NS_MEMB_FILE_SCOPE = NO +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- +GENERATE_SQLITE3 = NO +SQLITE3_OUTPUT = sqlite3 +SQLITE3_RECREATE_DB = YES +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = PREDEFINED = GENERATING_DOCUMENTATION \ ASIO_SOCKET_ERROR(e)=implementation_defined \ ASIO_NETDB_ERROR(e)=implementation_defined \ ASIO_EOF_ERROR(e)=implementation_defined \ - ASIO_OS_ERROR(e1,e2)=implementation_defined \ + "ASIO_OS_ERROR(e1,e2)=implementation_defined" \ ASIO_MOVE_ARG(a)=a&& \ ASIO_MOVE_OR_LVALUE_ARG(a)=a&& \ ASIO_NONDEDUCED_MOVE_ARG(a)=a& \ @@ -208,11 +320,11 @@ PREDEFINED = GENERATING_DOCUMENTATION \ ASIO_COMPLETION_SIGNATURE=typename \ ASIO_COMPLETION_HANDLER_FOR(s)=typename \ ASIO_COMPLETION_TOKEN_FOR(s)=typename \ - ASIO_COMPLETION_SIGNATURES_TPARAMS="typename... Signatures" \ + "ASIO_COMPLETION_SIGNATURES_TPARAMS=typename... Signatures" \ ASIO_COMPLETION_SIGNATURES_TARGS=Signatures... \ - ASIO_INITFN_RESULT_TYPE(t,a)=void_or_deduced \ - ASIO_INITFN_AUTO_RESULT_TYPE(t,a)=void_or_deduced \ - ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(t,a)=void_or_deduced \ + "ASIO_INITFN_RESULT_TYPE(t,a)=void_or_deduced" \ + "ASIO_INITFN_AUTO_RESULT_TYPE(t,a)=void_or_deduced" \ + "ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(t,a)=void_or_deduced" \ ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(e)= \ ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e)==default_token \ ASIO_DEFAULT_COMPLETION_TOKEN(e)==default_token \ @@ -237,46 +349,57 @@ PREDEFINED = GENERATING_DOCUMENTATION \ ASIO_EXECUTION_RECEIVER_OF_0=typename \ ASIO_NOEXCEPT_IF(c)= \ ASIO_AUTO_RETURN_TYPE_PREFIX(t)=auto \ - ASIO_AUTO_RETURN_TYPE_PREFIX2(t0,t1)=auto \ - ASIO_AUTO_RETURN_TYPE_PREFIX3(t0,t1,t2)=auto \ + "ASIO_AUTO_RETURN_TYPE_PREFIX2(t0,t1)=auto" \ + "ASIO_AUTO_RETURN_TYPE_PREFIX3(t0,t1,t2)=auto" \ ASIO_AUTO_RETURN_TYPE_SUFFIX(t)= -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- -TAGFILES = +TAGFILES = GENERATE_TAGFILE = reference.tags ALLEXTERNALS = NO EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl +EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" +DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = NO GROUP_GRAPHS = NO UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = NO CALL_GRAPH = NO +CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = NO DIRECTORY_GRAPH = NO +DIR_GRAPH_MAX_DEPTH = 1 DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 640 -MAX_DOT_GRAPH_HEIGHT = 640 +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +DIA_PATH = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = NO DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO +MSCGEN_TOOL = +MSCFILE_DIRS = diff --git a/asio/src/doc/reference.xsl b/asio/src/doc/reference.xsl index 71ad484ec4..e6b0780b91 100644 --- a/asio/src/doc/reference.xsl +++ b/asio/src/doc/reference.xsl @@ -10,7 +10,7 @@ - + @@ -116,7 +116,7 @@ + compounddef[@kind = 'namespace']/sectiondef[@kind = 'func' or @kind = 'var' or @kind = 'enum' or @kind = 'typedef']/memberdef"> @@ -848,22 +848,22 @@ ['Header: ] [^asio/ - + ] ['Convenience header: ] - + [^asio/execution.hpp] - + [^asio/ssl.hpp] - + None - + None @@ -1188,11 +1188,11 @@ ] - + [heading Friends] [table [[Name][Description]] - + @@ -1292,14 +1292,14 @@ - + - + @@ -1536,7 +1536,7 @@ static - = + ; @@ -1614,322 +1614,342 @@ + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + = diff --git a/asio/src/doc/tutorial.dox b/asio/src/doc/tutorial.dox index 1dac40d2c2..c362f951c1 100644 --- a/asio/src/doc/tutorial.dox +++ b/asio/src/doc/tutorial.dox @@ -1,43 +1,71 @@ -# Doxyfile 1.4.5 +# Doxyfile 1.9.8 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "Asio Tutorial" -PROJECT_NUMBER = +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +CREATE_SUBDIRS_LEVEL = 8 +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = ./../../ -STRIP_FROM_INC_PATH = -SHORT_NAMES = YES +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +JAVADOC_BANNER = NO +QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = YES -DETAILS_AT_TOP = YES +PYTHON_DOCSTRING = YES INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 2 -ALIASES = +ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_SLICE = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +TOC_INCLUDE_HEADINGS = 5 +MARKDOWN_ID_STYLE = DOXYGEN +AUTOLINK_SUPPORT = YES BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 +NUM_PROC_THREADS = 1 +TIMESTAMP = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = NO EXTRACT_PRIVATE = YES +EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PACKAGE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES HIDE_FRIEND_COMPOUNDS = NO @@ -45,182 +73,277 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES SHOW_INCLUDE_FILES = NO +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO INLINE_INFO = NO SORT_MEMBER_DOCS = NO SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO GENERATE_TODOLIST = NO GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST= NO -ENABLED_SECTIONS = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = NO -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES WARN_NO_PARAMDOC = NO +WARN_IF_UNDOC_ENUM_VAL = NO +WARN_AS_ERROR = NO WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +WARN_LINE_FORMAT = "at line $line of file $file" +WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ./../examples/cpp03/tutorial/index_dox.txt \ ./../examples/cpp03/tutorial/timer_dox.txt \ ./../examples/cpp03/tutorial/daytime_dox.txt \ ./boost_bind_dox.txt -FILE_PATTERNS = +INPUT_ENCODING = UTF-8 +INPUT_FILE_ENCODING = +FILE_PATTERNS = RECURSIVE = NO -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = EXAMPLE_PATH = ./../examples -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = YES -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +FORTRAN_COMMENT_AFTER = 72 #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 1 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = NO HTML_OUTPUT = . HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE = AUTO_LIGHT +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_CODE_FOLDING = YES +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDURL = +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO +CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO +SITEMAP_URL = +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 1 GENERATE_TREEVIEW = NO +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 1 TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +HTML_FORMULA_FORMAT = png +FORMULA_FONTSIZE = 10 +FORMULA_MACROFILE = +USE_MATHJAX = NO +MATHJAX_VERSION = MathJax_2 +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = NO +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex +LATEX_MAKEINDEX_CMD = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO +LATEX_BIB_STYLE = plain +LATEX_EMOJI_DIRECTORY = #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = YES XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES +XML_NS_MEMB_FILE_SCOPE = NO +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- +GENERATE_SQLITE3 = NO +SQLITE3_OUTPUT = sqlite3 +SQLITE3_RECREATE_DB = YES +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = PREDEFINED = GENERATING_DOCUMENTATION -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = reference.tags -GENERATE_TAGFILE = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl +EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" +DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = YES +UML_LIMIT_NUM_FIELDS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = NO CALL_GRAPH = NO +CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = NO DIRECTORY_GRAPH = YES +DIR_GRAPH_MAX_DEPTH = 1 DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +DIA_PATH = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = NO DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO +MSCGEN_TOOL = +MSCFILE_DIRS = From 544a87e85efb7b617b04471a3593f4c287e22040 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Wed, 8 Nov 2023 23:51:10 +1100 Subject: [PATCH 02/10] Regenerate documentation. --- asio/src/doc/reference.qbk | 27949 +++++++++++++++++------------------ asio/src/doc/tutorial.qbk | 280 +- 2 files changed, 13555 insertions(+), 14674 deletions(-) diff --git a/asio/src/doc/reference.qbk b/asio/src/doc/reference.qbk index 81ad4926f6..12d79ab381 100644 --- a/asio/src/doc/reference.qbk +++ b/asio/src/doc/reference.qbk @@ -181,7 +181,7 @@ A call wrapper type to bind an allocator of type `Allocator` to an object of typ [ [[link asio.reference.allocator_binder.operator_lp__rp_ [*operator()]]] - [] + [Forwarding function call operator. ] ] [ @@ -600,28 +600,32 @@ Obtain the associated allocator. [section:operator_lp__rp_ allocator_binder::operator()] [indexterm2 asio.indexterm.allocator_binder.operator_lp__rp_..operator()..allocator_binder] +Forwarding function call operator. + template< typename... Args> - auto ``[link asio.reference.allocator_binder.operator_lp__rp_.overload1 operator()]``( - Args && ...); + result_of_t< T(Args...)> ``[link asio.reference.allocator_binder.operator_lp__rp_.overload1 operator()]``( + Args &&... args); `` [''''»''' [link asio.reference.allocator_binder.operator_lp__rp_.overload1 more...]]`` template< typename... Args> - auto ``[link asio.reference.allocator_binder.operator_lp__rp_.overload2 operator()]``( - Args && ...) const; + result_of_t< T(Args...)> ``[link asio.reference.allocator_binder.operator_lp__rp_.overload2 operator()]``( + Args &&... args) const; `` [''''»''' [link asio.reference.allocator_binder.operator_lp__rp_.overload2 more...]]`` [section:overload1 allocator_binder::operator() (1 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...); + result_of_t< T(Args...)> operator()( + Args &&... args); @@ -632,11 +636,13 @@ Obtain the associated allocator. [section:overload2 allocator_binder::operator() (2 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...) const; + result_of_t< T(Args...)> operator()( + Args &&... args) const; @@ -760,7 +766,7 @@ Polymorphic executor type for use with I/O objects. class any_completion_executor : - public execution::any_executor< SupportableProperties > + public execution::any_executor<... > [heading Member Functions] @@ -864,11 +870,11 @@ Polymorphic executor type for use with I/O objects. The `any_completion_executor` type is a polymorphic executor that supports the set of properties required for the execution of completion handlers. It is defined as the [link asio.reference.execution__any_executor `execution::any_executor`] class template parameterised as follows: execution::any_executor< - execution::prefer_only, - execution::prefer_only - execution::prefer_only, - execution::prefer_only - > + execution::prefer_only, + execution::prefer_only + execution::prefer_only, + execution::prefer_only + > @@ -919,14 +925,14 @@ Construct to point to the same target as another any\_executor. template< class... OtherSupportableProperties> ``[link asio.reference.any_completion_executor.any_completion_executor.overload5 any_completion_executor]``( - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); `` [''''»''' [link asio.reference.any_completion_executor.any_completion_executor.overload5 more...]]`` template< class... OtherSupportableProperties> ``[link asio.reference.any_completion_executor.any_completion_executor.overload6 any_completion_executor]``( std::nothrow_t , - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); `` [''''»''' [link asio.reference.any_completion_executor.any_completion_executor.overload6 more...]]`` ``[link asio.reference.any_completion_executor.any_completion_executor.overload7 any_completion_executor]``( @@ -1025,7 +1031,7 @@ Construct to point to the same target as another any\_executor. template< class... OtherSupportableProperties> any_completion_executor( - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); @@ -1043,7 +1049,7 @@ Construct to point to the same target as another any\_executor. class... OtherSupportableProperties> any_completion_executor( std::nothrow_t , - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); @@ -1191,18 +1197,18 @@ Inequality operator. bool ``[link asio.reference.any_completion_executor.operator_not__eq_.overload1 operator!=]``( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_completion_executor.operator_not__eq_.overload1 more...]]`` bool ``[link asio.reference.any_completion_executor.operator_not__eq_.overload2 operator!=]``( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); `` [''''»''' [link asio.reference.any_completion_executor.operator_not__eq_.overload2 more...]]`` bool ``[link asio.reference.any_completion_executor.operator_not__eq_.overload3 operator!=]``( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_completion_executor.operator_not__eq_.overload3 more...]]`` @@ -1215,9 +1221,11 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); @@ -1234,8 +1242,10 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); @@ -1253,9 +1263,11 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); @@ -1344,18 +1356,18 @@ Equality operator. bool ``[link asio.reference.any_completion_executor.operator_eq__eq_.overload1 operator==]``( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_completion_executor.operator_eq__eq_.overload1 more...]]`` bool ``[link asio.reference.any_completion_executor.operator_eq__eq_.overload2 operator==]``( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); `` [''''»''' [link asio.reference.any_completion_executor.operator_eq__eq_.overload2 more...]]`` bool ``[link asio.reference.any_completion_executor.operator_eq__eq_.overload3 operator==]``( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_completion_executor.operator_eq__eq_.overload3 more...]]`` @@ -1368,9 +1380,11 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); @@ -1387,8 +1401,10 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); @@ -1406,9 +1422,11 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); @@ -1427,7 +1445,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_completion_executor ``[link asio.reference.any_completion_executor.prefer.overload1 prefer]``( const Property & p, - typename constraint< traits::prefer_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::prefer_member< const base_type &, const Property & >::is_valid > = 0) const; `` [''''»''' [link asio.reference.any_completion_executor.prefer.overload1 more...]]`` @@ -1456,8 +1474,6 @@ Obtain a polymorphic wrapper with the specified property. int ) const; `` [''''»''' [link asio.reference.any_completion_executor.prefer.overload5 more...]]`` - template< - typename Property> any_executor ``[link asio.reference.any_completion_executor.prefer.overload6 prefer]``( Property ) const; `` [''''»''' [link asio.reference.any_completion_executor.prefer.overload6 more...]]`` @@ -1473,7 +1489,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_completion_executor prefer( const Property & p, - typename constraint< traits::prefer_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::prefer_member< const base_type &, const Property & >::is_valid > = 0) const; Do not call this function directly. It is intended for use with the [link asio.reference.prefer `prefer`] customisation point. @@ -1481,7 +1497,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: any_completion_executor ex = ...; - auto ex2 = asio::prefer(ex, execution::relationship.fork); + auto ex2 = asio::prefer(ex, execution::relationship.fork); @@ -1571,7 +1587,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - auto ex2 = asio::prefer(ex, execution::blocking.possibly); + auto ex2 = asio::prefer(ex, execution::blocking.possibly); @@ -1603,7 +1619,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - size_t n = asio::query(ex, execution::occupancy); + size_t n = asio::query(ex, execution::occupancy); @@ -1622,11 +1638,9 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_completion_executor ``[link asio.reference.any_completion_executor.require.overload1 require]``( const Property & p, - typename constraint< traits::require_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::require_member< const base_type &, const Property & >::is_valid > = 0) const; `` [''''»''' [link asio.reference.any_completion_executor.require.overload1 more...]]`` - template< - typename Property> any_executor ``[link asio.reference.any_completion_executor.require.overload2 require]``( Property ) const; `` [''''»''' [link asio.reference.any_completion_executor.require.overload2 more...]]`` @@ -1642,7 +1656,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_completion_executor require( const Property & p, - typename constraint< traits::require_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::require_member< const base_type &, const Property & >::is_valid > = 0) const; Do not call this function directly. It is intended for use with the [link asio.reference.require `require`] and [link asio.reference.prefer `prefer`] customisation points. @@ -1650,7 +1664,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: any_completion_executor ex = ...; - auto ex2 = asio::require(ex, execution::relationship.fork); + auto ex2 = asio::require(ex, execution::relationship.fork); @@ -1680,7 +1694,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - auto ex2 = asio::requre(ex, execution::blocking.possibly); + auto ex2 = asio::requre(ex, execution::blocking.possibly); @@ -1746,13 +1760,9 @@ Swap targets with another polymorphic wrapper. Get a pointer to the target executor. - template< - typename ``[link asio.reference.Executor1 Executor]``> Executor * ``[link asio.reference.any_completion_executor.target.overload1 target]``(); `` [''''»''' [link asio.reference.any_completion_executor.target.overload1 more...]]`` - template< - typename ``[link asio.reference.Executor1 Executor]``> const Executor * ``[link asio.reference.any_completion_executor.target.overload2 target]``() const; `` [''''»''' [link asio.reference.any_completion_executor.target.overload2 more...]]`` @@ -1843,6 +1853,26 @@ Polymorphic wrapper for completion handlers. class any_completion_handler +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.any_completion_handler.allocator_type [*allocator_type]]] + [The associated allocator type. ] + + ] + + [ + + [[link asio.reference.any_completion_handler.cancellation_slot_type [*cancellation_slot_type]]] + [The associated cancellation slot type. ] + + ] + +] + [heading Member Functions] [table [[Name][Description]] @@ -1936,6 +1966,71 @@ Typical uses for `any_completion_handler` include: ['Convenience header: ][^asio.hpp] + +[section:allocator_type any_completion_handler::allocator_type] + +[indexterm2 asio.indexterm.any_completion_handler.allocator_type..allocator_type..any_completion_handler] +The associated allocator type. + + + typedef any_completion_handler_allocator< void, Signatures... > allocator_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/any_completion_handler.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:any_completion_handler any_completion_handler::any_completion_handler] [indexterm2 asio.indexterm.any_completion_handler.any_completion_handler..any_completion_handler..any_completion_handler] @@ -1955,10 +2050,10 @@ Construct an `any_completion_handler` to contain the specified target. template< typename H, - typename ``[link asio.reference.Handler Handler]`` = typename decay::type> + typename ``[link asio.reference.Handler Handler]`` = decay_t> ``[link asio.reference.any_completion_handler.any_completion_handler.overload3 any_completion_handler]``( H && h, - typename constraint< !is_same< typename decay< H >::type, any_completion_handler >::value >::type = 0); + constraint_t< !is_same< decay_t< H >, any_completion_handler >::value > = 0); `` [''''»''' [link asio.reference.any_completion_handler.any_completion_handler.overload3 more...]]`` @@ -2007,10 +2102,10 @@ Construct an `any_completion_handler` to contain the specified target. template< typename H, - typename ``[link asio.reference.Handler Handler]`` = typename decay::type> + typename ``[link asio.reference.Handler Handler]`` = decay_t> any_completion_handler( H && h, - typename constraint< !is_same< typename decay< H >::type, any_completion_handler >::value >::type = 0); + constraint_t< !is_same< decay_t< H >, any_completion_handler >::value > = 0); @@ -2037,6 +2132,79 @@ After the operation, the moved-from object `other` has no target. [endsect] +[section:cancellation_slot_type any_completion_handler::cancellation_slot_type] + +[indexterm2 asio.indexterm.any_completion_handler.cancellation_slot_type..cancellation_slot_type..any_completion_handler] +The associated cancellation slot type. + + + typedef cancellation_slot cancellation_slot_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.cancellation_slot.assign [*assign]]] + [Installs a handler into the slot. ] + ] + + [ + [[link asio.reference.cancellation_slot.cancellation_slot [*cancellation_slot]] [constructor]] + [Creates a slot that is not connected to any cancellation signal. ] + ] + + [ + [[link asio.reference.cancellation_slot.clear [*clear]]] + [Clears the slot. ] + ] + + [ + [[link asio.reference.cancellation_slot.emplace [*emplace]]] + [Installs a handler into the slot, constructing the new object directly. ] + ] + + [ + [[link asio.reference.cancellation_slot.has_handler [*has_handler]]] + [Returns whether the slot is connected and has an installed handler. ] + ] + + [ + [[link asio.reference.cancellation_slot.is_connected [*is_connected]]] + [Returns whether the slot is connected to a signal. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.cancellation_slot.operator_not__eq_ [*operator!=]]] + [Compare two slots for inequality. ] + ] + + [ + [[link asio.reference.cancellation_slot.operator_eq__eq_ [*operator==]]] + [Compare two slots for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/any_completion_handler.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:get_allocator any_completion_handler::get_allocator] [indexterm2 asio.indexterm.any_completion_handler.get_allocator..get_allocator..any_completion_handler] @@ -2098,12 +2266,12 @@ Test if the polymorphic wrapper is non-empty. Inequality operator. - friend constexpr bool ``[link asio.reference.any_completion_handler.operator_not__eq_.overload1 operator!=]``( + constexpr bool ``[link asio.reference.any_completion_handler.operator_not__eq_.overload1 operator!=]``( const any_completion_handler & a, nullptr_t ); `` [''''»''' [link asio.reference.any_completion_handler.operator_not__eq_.overload1 more...]]`` - friend constexpr bool ``[link asio.reference.any_completion_handler.operator_not__eq_.overload2 operator!=]``( + constexpr bool ``[link asio.reference.any_completion_handler.operator_not__eq_.overload2 operator!=]``( nullptr_t , const any_completion_handler & b); `` [''''»''' [link asio.reference.any_completion_handler.operator_not__eq_.overload2 more...]]`` @@ -2115,7 +2283,7 @@ Inequality operator. Inequality operator. - friend constexpr bool operator!=( + constexpr bool operator!=( const any_completion_handler & a, nullptr_t ); @@ -2137,7 +2305,7 @@ Inequality operator. Inequality operator. - friend constexpr bool operator!=( + constexpr bool operator!=( nullptr_t , const any_completion_handler & b); @@ -2235,12 +2403,12 @@ Assignment operator that sets the polymorphic wrapper to the empty state. Equality operator. - friend constexpr bool ``[link asio.reference.any_completion_handler.operator_eq__eq_.overload1 operator==]``( + constexpr bool ``[link asio.reference.any_completion_handler.operator_eq__eq_.overload1 operator==]``( const any_completion_handler & a, nullptr_t ); `` [''''»''' [link asio.reference.any_completion_handler.operator_eq__eq_.overload1 more...]]`` - friend constexpr bool ``[link asio.reference.any_completion_handler.operator_eq__eq_.overload2 operator==]``( + constexpr bool ``[link asio.reference.any_completion_handler.operator_eq__eq_.overload2 operator==]``( nullptr_t , const any_completion_handler & b); `` [''''»''' [link asio.reference.any_completion_handler.operator_eq__eq_.overload2 more...]]`` @@ -2252,7 +2420,7 @@ Equality operator. Equality operator. - friend constexpr bool operator==( + constexpr bool operator==( const any_completion_handler & a, nullptr_t ); @@ -2274,7 +2442,7 @@ Equality operator. Equality operator. - friend constexpr bool operator==( + constexpr bool operator==( nullptr_t , const any_completion_handler & b); @@ -2412,7 +2580,7 @@ Construct from another `any_completion_handler_allocator`. template< typename U> constexpr any_completion_handler_allocator( - const any_completion_handler_allocator< U, Signatures...> & a); + const any_completion_handler_allocator< U, Signatures... > & a); @@ -2528,7 +2696,7 @@ Rebinds an allocator to another value type. Specifies the type of the rebound allocator. - typedef any_completion_handler_allocator< U, Signatures...> other; + typedef any_completion_handler_allocator< U, Signatures... > other; [heading Types] @@ -2589,9 +2757,9 @@ Specifies the type of the rebound allocator. [endsect] -[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_ any_completion_handler_allocator< void, Signatures...>] +[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_ any_completion_handler_allocator< void, Signatures... >] -[indexterm1 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_..any_completion_handler_allocator< void, Signatures\.\.\.>] +[indexterm1 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_..any_completion_handler_allocator< void, Signatures\.\.\. >] A protoco-allocator type that may be rebound to obtain an allocator that forwards memory allocation operations through an instance of `any_completion_handler`. @@ -2599,7 +2767,7 @@ A protoco-allocator type that may be rebound to obtain an allocator that forward template< typename... Signatures> - class any_completion_handler_allocator< void, Signatures...> + class any_completion_handler_allocator< void, Signatures... > [heading Types] @@ -2608,7 +2776,7 @@ A protoco-allocator type that may be rebound to obtain an allocator that forward [ - [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.value_type [*value_type]]] + [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.value_type [*value_type]]] [void as no objects can be allocated through a proto-allocator. ] ] @@ -2620,17 +2788,17 @@ A protoco-allocator type that may be rebound to obtain an allocator that forward [[Name][Description]] [ - [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.any_completion_handler_allocator [*any_completion_handler_allocator]]] + [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.any_completion_handler_allocator [*any_completion_handler_allocator]]] [Construct from another any_completion_handler_allocator. ] ] [ - [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_not__eq_ [*operator!=]]] + [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.operator_not__eq_ [*operator!=]]] [Inequality operator. ] ] [ - [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_eq__eq_ [*operator==]]] + [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.operator_eq__eq_ [*operator==]]] [Equality operator. ] ] @@ -2643,16 +2811,16 @@ A protoco-allocator type that may be rebound to obtain an allocator that forward ['Convenience header: ][^asio.hpp] -[section:any_completion_handler_allocator any_completion_handler_allocator< void, Signatures...>::any_completion_handler_allocator] +[section:any_completion_handler_allocator any_completion_handler_allocator< void, Signatures... >::any_completion_handler_allocator] -[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.any_completion_handler_allocator..any_completion_handler_allocator..any_completion_handler_allocator< void, Signatures\.\.\.>] +[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.any_completion_handler_allocator..any_completion_handler_allocator..any_completion_handler_allocator< void, Signatures\.\.\. >] Construct from another `any_completion_handler_allocator`. template< typename U> constexpr any_completion_handler_allocator( - const any_completion_handler_allocator< U, Signatures...> & a); + const any_completion_handler_allocator< U, Signatures... > & a); @@ -2660,9 +2828,9 @@ Construct from another `any_completion_handler_allocator`. -[section:operator_not__eq_ any_completion_handler_allocator< void, Signatures...>::operator!=] +[section:operator_not__eq_ any_completion_handler_allocator< void, Signatures... >::operator!=] -[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_not__eq_..operator!=..any_completion_handler_allocator< void, Signatures\.\.\.>] +[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.operator_not__eq_..operator!=..any_completion_handler_allocator< void, Signatures\.\.\. >] Inequality operator. @@ -2675,9 +2843,9 @@ Inequality operator. -[section:operator_eq__eq_ any_completion_handler_allocator< void, Signatures...>::operator==] +[section:operator_eq__eq_ any_completion_handler_allocator< void, Signatures... >::operator==] -[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_eq__eq_..operator==..any_completion_handler_allocator< void, Signatures\.\.\.>] +[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.operator_eq__eq_..operator==..any_completion_handler_allocator< void, Signatures\.\.\. >] Equality operator. @@ -2690,9 +2858,9 @@ Equality operator. -[section:value_type any_completion_handler_allocator< void, Signatures...>::value_type] +[section:value_type any_completion_handler_allocator< void, Signatures... >::value_type] -[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.value_type..value_type..any_completion_handler_allocator< void, Signatures\.\.\.>] +[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.value_type..value_type..any_completion_handler_allocator< void, Signatures\.\.\. >] `void` as no objects can be allocated through a proto-allocator. @@ -2713,9 +2881,9 @@ Equality operator. [endsect] -[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind any_completion_handler_allocator< void, Signatures...>::rebind] +[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind any_completion_handler_allocator< void, Signatures... >::rebind] -[indexterm1 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind..any_completion_handler_allocator< void, Signatures\.\.\.>::rebind] +[indexterm1 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind..any_completion_handler_allocator< void, Signatures\.\.\. >::rebind] Rebinds an allocator to another value type. @@ -2723,7 +2891,7 @@ Rebinds an allocator to another value type. template< typename U> - struct any_completion_handler_allocator< void, Signatures...>::rebind + struct any_completion_handler_allocator< void, Signatures... >::rebind [heading Types] @@ -2732,7 +2900,7 @@ Rebinds an allocator to another value type. [ - [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.other [*other]]] + [[link asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind.other [*other]]] [Specifies the type of the rebound allocator. ] ] @@ -2746,13 +2914,13 @@ Rebinds an allocator to another value type. ['Convenience header: ][^asio.hpp] -[section:other any_completion_handler_allocator< void, Signatures...>::rebind::other] +[section:other any_completion_handler_allocator< void, Signatures... >::rebind::other] -[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.other..other..any_completion_handler_allocator< void, Signatures\.\.\.>::rebind] +[indexterm2 asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind.other..other..any_completion_handler_allocator< void, Signatures\.\.\. >::rebind] Specifies the type of the rebound allocator. - typedef any_completion_handler_allocator< U, Signatures...> other; + typedef any_completion_handler_allocator< U, Signatures... > other; [heading Types] @@ -2822,7 +2990,7 @@ Polymorphic executor type for use with I/O objects. class any_io_executor : - public execution::any_executor< SupportableProperties > + public execution::any_executor<... > [heading Member Functions] @@ -2926,14 +3094,14 @@ Polymorphic executor type for use with I/O objects. 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 [link asio.reference.execution__any_executor `execution::any_executor`] class template parameterised as follows: 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 - > + execution::context_as_t, + execution::blocking_t::never_t, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only + > @@ -2984,14 +3152,14 @@ Construct to point to the same target as another any\_executor. template< class... OtherSupportableProperties> ``[link asio.reference.any_io_executor.any_io_executor.overload5 any_io_executor]``( - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); `` [''''»''' [link asio.reference.any_io_executor.any_io_executor.overload5 more...]]`` template< class... OtherSupportableProperties> ``[link asio.reference.any_io_executor.any_io_executor.overload6 any_io_executor]``( std::nothrow_t , - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); `` [''''»''' [link asio.reference.any_io_executor.any_io_executor.overload6 more...]]`` ``[link asio.reference.any_io_executor.any_io_executor.overload7 any_io_executor]``( @@ -3090,7 +3258,7 @@ Construct to point to the same target as another any\_executor. template< class... OtherSupportableProperties> any_io_executor( - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); @@ -3108,7 +3276,7 @@ Construct to point to the same target as another any\_executor. class... OtherSupportableProperties> any_io_executor( std::nothrow_t , - execution::any_executor< OtherSupportableProperties...> e); + execution::any_executor< OtherSupportableProperties... > e); @@ -3256,18 +3424,18 @@ Inequality operator. bool ``[link asio.reference.any_io_executor.operator_not__eq_.overload1 operator!=]``( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_io_executor.operator_not__eq_.overload1 more...]]`` bool ``[link asio.reference.any_io_executor.operator_not__eq_.overload2 operator!=]``( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); `` [''''»''' [link asio.reference.any_io_executor.operator_not__eq_.overload2 more...]]`` bool ``[link asio.reference.any_io_executor.operator_not__eq_.overload3 operator!=]``( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_io_executor.operator_not__eq_.overload3 more...]]`` @@ -3280,9 +3448,11 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); @@ -3299,8 +3469,10 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); @@ -3318,9 +3490,11 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); @@ -3409,18 +3583,18 @@ Equality operator. bool ``[link asio.reference.any_io_executor.operator_eq__eq_.overload1 operator==]``( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_io_executor.operator_eq__eq_.overload1 more...]]`` bool ``[link asio.reference.any_io_executor.operator_eq__eq_.overload2 operator==]``( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); `` [''''»''' [link asio.reference.any_io_executor.operator_eq__eq_.overload2 more...]]`` bool ``[link asio.reference.any_io_executor.operator_eq__eq_.overload3 operator==]``( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.any_io_executor.operator_eq__eq_.overload3 more...]]`` @@ -3433,9 +3607,11 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); @@ -3452,8 +3628,10 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); @@ -3471,9 +3649,11 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); @@ -3492,7 +3672,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_io_executor ``[link asio.reference.any_io_executor.prefer.overload1 prefer]``( const Property & p, - typename constraint< traits::prefer_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::prefer_member< const base_type &, const Property & >::is_valid > = 0) const; `` [''''»''' [link asio.reference.any_io_executor.prefer.overload1 more...]]`` template<> @@ -3525,8 +3705,6 @@ Obtain a polymorphic wrapper with the specified property. int ) const; `` [''''»''' [link asio.reference.any_io_executor.prefer.overload6 more...]]`` - template< - typename Property> any_executor ``[link asio.reference.any_io_executor.prefer.overload7 prefer]``( Property ) const; `` [''''»''' [link asio.reference.any_io_executor.prefer.overload7 more...]]`` @@ -3542,7 +3720,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_io_executor prefer( const Property & p, - typename constraint< traits::prefer_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::prefer_member< const base_type &, const Property & >::is_valid > = 0) const; Do not call this function directly. It is intended for use with the [link asio.reference.prefer `prefer`] customisation point. @@ -3550,7 +3728,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: any_io_executor ex = ...; - auto ex2 = asio::prefer(ex, execution::blocking.possibly); + auto ex2 = asio::prefer(ex, execution::blocking.possibly); @@ -3655,7 +3833,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - auto ex2 = asio::prefer(ex, execution::blocking.possibly); + auto ex2 = asio::prefer(ex, execution::blocking.possibly); @@ -3687,7 +3865,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - size_t n = asio::query(ex, execution::occupancy); + size_t n = asio::query(ex, execution::occupancy); @@ -3706,7 +3884,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_io_executor ``[link asio.reference.any_io_executor.require.overload1 require]``( const Property & p, - typename constraint< traits::require_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::require_member< const base_type &, const Property & >::is_valid > = 0) const; `` [''''»''' [link asio.reference.any_io_executor.require.overload1 more...]]`` @@ -3717,8 +3895,6 @@ Obtain a polymorphic wrapper with the specified property. int ) const; `` [''''»''' [link asio.reference.any_io_executor.require.overload2 more...]]`` - template< - typename Property> any_executor ``[link asio.reference.any_io_executor.require.overload3 require]``( Property ) const; `` [''''»''' [link asio.reference.any_io_executor.require.overload3 more...]]`` @@ -3734,7 +3910,7 @@ Obtain a polymorphic wrapper with the specified property. typename Property> any_io_executor require( const Property & p, - typename constraint< traits::require_member< const base_type &, const Property & >::is_valid >::type = 0) const; + constraint_t< traits::require_member< const base_type &, const Property & >::is_valid > = 0) const; Do not call this function directly. It is intended for use with the [link asio.reference.require `require`] and [link asio.reference.prefer `prefer`] customisation points. @@ -3742,7 +3918,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: any_io_executor ex = ...; - auto ex2 = asio::require(ex, execution::blocking.possibly); + auto ex2 = asio::require(ex, execution::blocking.possibly); @@ -3787,7 +3963,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - auto ex2 = asio::requre(ex, execution::blocking.possibly); + auto ex2 = asio::requre(ex, execution::blocking.possibly); @@ -3853,13 +4029,9 @@ Swap targets with another polymorphic wrapper. Get a pointer to the target executor. - template< - typename ``[link asio.reference.Executor1 Executor]``> Executor * ``[link asio.reference.any_io_executor.target.overload1 target]``(); `` [''''»''' [link asio.reference.any_io_executor.target.overload1 more...]]`` - template< - typename ``[link asio.reference.Executor1 Executor]``> const Executor * ``[link asio.reference.any_io_executor.target.overload2 target]``() const; `` [''''»''' [link asio.reference.any_io_executor.target.overload2 more...]]`` @@ -3948,7 +4120,7 @@ Completion token type used to specify that the completion handler arguments shou template< typename CompletionToken, typename... Values> - constexpr append_t< typename decay< CompletionToken >::type, typename decay< Values >::type...> append( + constexpr append_t< decay_t< CompletionToken >, decay_t< Values >... > append( CompletionToken && completion_token, Values &&... values); @@ -4046,7 +4218,7 @@ Constructor. [indexterm2 asio.indexterm.append_t.values_..values_..append_t] - std::tuple< Values...> values_; + std::tuple< Values... > values_; @@ -4066,7 +4238,7 @@ Adapt a [link asio.overview.model.completion_tokens completion token] to specify template< typename CompletionToken> - constexpr as_tuple_t< typename decay< CompletionToken >::type > as_tuple( + constexpr as_tuple_t< decay_t< CompletionToken > > as_tuple( CompletionToken && completion_token); @@ -4097,6 +4269,13 @@ A [link asio.overview.model.completion_tokens completion token] adapter used to [table [[Name][Description]] + [ + + [[link asio.reference.as_tuple_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use as_tuple_t as its default completion token type. ] + + ] + [ [[link asio.reference.as_tuple_t__default_constructor_tag [*default_constructor_tag]]] @@ -4159,7 +4338,7 @@ Function helper to adapt an I/O object to use `as_tuple_t` as its default comple template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -4167,110 +4346,14 @@ Function helper to adapt an I/O object to use `as_tuple_t` as its default comple [endsect] -[section:as_tuple_t as_tuple_t::as_tuple_t] - -[indexterm2 asio.indexterm.as_tuple_t.as_tuple_t..as_tuple_t..as_tuple_t] -Default constructor. - - - constexpr ``[link asio.reference.as_tuple_t.as_tuple_t.overload1 as_tuple_t]``( - default_constructor_tag = default_constructor_tag(), - CompletionToken token = CompletionToken()); - `` [''''»''' [link asio.reference.as_tuple_t.as_tuple_t.overload1 more...]]`` - -Constructor. +[section:as_default_on_t as_tuple_t::as_default_on_t] +[indexterm2 asio.indexterm.as_tuple_t.as_default_on_t..as_default_on_t..as_tuple_t] +Type alias to adapt an I/O object to use `as_tuple_t` as its default completion token type. - template< - typename T> - explicit constexpr ``[link asio.reference.as_tuple_t.as_tuple_t.overload2 as_tuple_t]``( - T && completion_token); - `` [''''»''' [link asio.reference.as_tuple_t.as_tuple_t.overload2 more...]]`` - - -[section:overload1 as_tuple_t::as_tuple_t (1 of 2 overloads)] - - -Default constructor. - - constexpr as_tuple_t( - default_constructor_tag = default_constructor_tag(), - CompletionToken token = CompletionToken()); - - -This constructor is only valid if the underlying completion token is default constructible and move constructible. The underlying completion token is itself defaulted as an argument to allow it to capture a source location. - - -[endsect] - - - -[section:overload2 as_tuple_t::as_tuple_t (2 of 2 overloads)] - - -Constructor. - - - template< - typename T> - constexpr as_tuple_t( - T && completion_token); - - - -[endsect] - - -[endsect] - - -[section:token_ as_tuple_t::token_] - -[indexterm2 asio.indexterm.as_tuple_t.token_..token_..as_tuple_t] - - CompletionToken token_; - - - -[endsect] - - - -[endsect] - -[section:as_tuple_t__default_constructor_tag as_tuple_t::default_constructor_tag] - -[indexterm1 asio.indexterm.as_tuple_t__default_constructor_tag..as_tuple_t::default_constructor_tag] - - -Tag type used to prevent the "default" constructor from being used for conversions. - - - struct default_constructor_tag - - -[heading Requirements] - -['Header: ][^asio/as_tuple.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - -[section:as_tuple_t__executor_with_default as_tuple_t::executor_with_default] - -[indexterm1 asio.indexterm.as_tuple_t__executor_with_default..as_tuple_t::executor_with_default] - - -Adapts an executor to add the `as_tuple_t` completion token as the default. - - - template< - typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + typedef typename T::template rebind_executor< executor_with_default< typename T::executor_type > >::other as_default_on_t; [heading Types] @@ -4297,6 +4380,7 @@ Adapts an executor to add the `as_tuple_t` completion token as the default. ] + [heading Requirements] ['Header: ][^asio/as_tuple.hpp] @@ -4304,284 +4388,244 @@ Adapts an executor to add the `as_tuple_t` completion token as the default. ['Convenience header: ][^asio.hpp] -[section:default_completion_token_type as_tuple_t::executor_with_default::default_completion_token_type] - -[indexterm2 asio.indexterm.as_tuple_t__executor_with_default.default_completion_token_type..default_completion_token_type..as_tuple_t::executor_with_default] -Specify `as_tuple_t` as the default completion token type. - +[endsect] - typedef as_tuple_t default_completion_token_type; +[section:as_tuple_t as_tuple_t::as_tuple_t] -[heading Types] -[table - [[Name][Description]] +[indexterm2 asio.indexterm.as_tuple_t.as_tuple_t..as_tuple_t..as_tuple_t] +Default constructor. - [ - [[link asio.reference.as_tuple_t__default_constructor_tag [*default_constructor_tag]]] - [Tag type used to prevent the "default" constructor from being used for conversions. ] - - ] - - [ + constexpr ``[link asio.reference.as_tuple_t.as_tuple_t.overload1 as_tuple_t]``( + default_constructor_tag = default_constructor_tag(), + CompletionToken token = CompletionToken()); + `` [''''»''' [link asio.reference.as_tuple_t.as_tuple_t.overload1 more...]]`` - [[link asio.reference.as_tuple_t__executor_with_default [*executor_with_default]]] - [Adapts an executor to add the as_tuple_t completion token as the default. ] - - ] -] +Constructor. -[heading Member Functions] -[table - [[Name][Description]] - [ - [[link asio.reference.as_tuple_t.as_default_on [*as_default_on]] [static]] - [Function helper to adapt an I/O object to use as_tuple_t as its default completion token type. ] - ] - - [ - [[link asio.reference.as_tuple_t.as_tuple_t [*as_tuple_t]] [constructor]] - [Default constructor. - [hr] - Constructor. ] - ] - -] + template< + typename T> + explicit constexpr ``[link asio.reference.as_tuple_t.as_tuple_t.overload2 as_tuple_t]``( + T && completion_token); + `` [''''»''' [link asio.reference.as_tuple_t.as_tuple_t.overload2 more...]]`` -[heading Data Members] -[table - [[Name][Description]] - [ - [[link asio.reference.as_tuple_t.token_ [*token_]]] - [] - ] +[section:overload1 as_tuple_t::as_tuple_t (1 of 2 overloads)] -] -The [link asio.reference.as_tuple_t `as_tuple_t`] class is used to indicate that any arguments to the completion handler should be combined and passed as a single tuple argument. The arguments are first moved into a `std::tuple` and that tuple is then passed to the completion handler. +Default constructor. -[heading Requirements] + constexpr as_tuple_t( + default_constructor_tag = default_constructor_tag(), + CompletionToken token = CompletionToken()); -['Header: ][^asio/as_tuple.hpp] -['Convenience header: ][^asio.hpp] +This constructor is only valid if the underlying completion token is default constructible and move constructible. The underlying completion token is itself defaulted as an argument to allow it to capture a source location. [endsect] -[section:executor_with_default as_tuple_t::executor_with_default::executor_with_default] +[section:overload2 as_tuple_t::as_tuple_t (2 of 2 overloads)] -[indexterm2 asio.indexterm.as_tuple_t__executor_with_default.executor_with_default..executor_with_default..as_tuple_t::executor_with_default] -Construct the adapted executor from the inner executor type. + +Constructor. template< - typename ``[link asio.reference.Executor1 InnerExecutor1]``> - executor_with_default( - const InnerExecutor1 & ex, - typename constraint< conditional< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::type::value >::type = 0); + typename T> + constexpr as_tuple_t( + T && completion_token); [endsect] - [endsect] -[section:asio_handler_allocate asio_handler_allocate] - -[indexterm1 asio.indexterm.asio_handler_allocate..asio_handler_allocate] - -(Deprecated: Use the [link asio.reference.associated_allocator `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. +[section:token_ as_tuple_t::token_] -Implement asio\_handler\_allocate and asio\_handler\_deallocate for your own handlers to provide custom allocation for these temporary objects. +[indexterm2 asio.indexterm.as_tuple_t.token_..token_..as_tuple_t] -The default implementation of these allocation hooks uses `operator new` and `operator delete`. + CompletionToken token_; -[heading 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. +[endsect] -[heading Example] - - class my_handler; +[endsect] - void* asio_handler_allocate(std::size_t size, my_handler* context) - { - return ::operator new(size); - } +[section:as_tuple_t__default_constructor_tag as_tuple_t::default_constructor_tag] - void asio_handler_deallocate(void* pointer, std::size_t size, - my_handler* context) - { - ::operator delete(pointer); - } +[indexterm1 asio.indexterm.as_tuple_t__default_constructor_tag..as_tuple_t::default_constructor_tag] +Tag type used to prevent the "default" constructor from being used for conversions. + struct default_constructor_tag [heading Requirements] -['Header: ][^asio/handler_alloc_hook.hpp] +['Header: ][^asio/as_tuple.hpp] ['Convenience header: ][^asio.hpp] [endsect] +[section:as_tuple_t__executor_with_default as_tuple_t::executor_with_default] +[indexterm1 asio.indexterm.as_tuple_t__executor_with_default..as_tuple_t::executor_with_default] -[section:asio_handler_deallocate asio_handler_deallocate] -[indexterm1 asio.indexterm.asio_handler_deallocate..asio_handler_deallocate] +Adapts an executor to add the `as_tuple_t` completion token as the default. -Default deallocation function for handlers. + template< + typename ``[link asio.reference.Executor1 InnerExecutor]``> + struct executor_with_default : + public InnerExecutor - asio_handler_deallocate_is_deprecated asio_handler_deallocate( - void * pointer, - std::size_t size, - ... ); +[heading Types] +[table + [[Name][Description]] -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`. + [[link asio.reference.as_tuple_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify as_tuple_t as the default completion token type. ] + + ] +] +[heading Member Functions] +[table + [[Name][Description]] + [ + [[link asio.reference.as_tuple_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. ] + ] + +] [heading Requirements] -['Header: ][^asio/handler_alloc_hook.hpp] +['Header: ][^asio/as_tuple.hpp] ['Convenience header: ][^asio.hpp] -[endsect] - - -[section:asio_handler_invoke asio_handler_invoke] - -[indexterm1 asio.indexterm.asio_handler_invoke..asio_handler_invoke] - -(Deprecated: Use the [link asio.reference.associated_executor `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 ``[link asio.reference.asio_handler_invoke.overload1 asio_handler_invoke]``( - Function & function, - ... ); - `` [''''»''' [link asio.reference.asio_handler_invoke.overload1 more...]]`` +[section:default_completion_token_type as_tuple_t::executor_with_default::default_completion_token_type] -Default handler invocation hook used for const function objects. +[indexterm2 asio.indexterm.as_tuple_t__executor_with_default.default_completion_token_type..default_completion_token_type..as_tuple_t::executor_with_default] +Specify `as_tuple_t` as the default completion token type. - template< - typename Function> - asio_handler_invoke_is_deprecated ``[link asio.reference.asio_handler_invoke.overload2 asio_handler_invoke]``( - const Function & function, - ... ); - `` [''''»''' [link asio.reference.asio_handler_invoke.overload2 more...]]`` -Completion handlers for asynchronous operations are invoked by the [link asio.reference.io_context `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 [link asio.reference.io_context `io_context`] object. Handlers may subsequently be invoked through other objects (such as [link asio.reference.io_context__strand `io_context::strand`] objects) that provide additional guarantees. + typedef as_tuple_t default_completion_token_type; -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. +[heading Types] +[table + [[Name][Description]] -This default implementation invokes the function object like so: + [ - function(); + [[link asio.reference.as_tuple_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use as_tuple_t as its default completion token type. ] + + ] + [ -If necessary, the default implementation makes a copy of the function object so that the non-const operator() can be used. + [[link asio.reference.as_tuple_t__default_constructor_tag [*default_constructor_tag]]] + [Tag type used to prevent the "default" constructor from being used for conversions. ] + + ] + [ -[heading Example] + [[link asio.reference.as_tuple_t__executor_with_default [*executor_with_default]]] + [Adapts an executor to add the as_tuple_t completion token as the default. ] + ] +] - class my_handler; +[heading Member Functions] +[table + [[Name][Description]] - template - void asio_handler_invoke(Function function, my_handler* context) - { - context->strand_.dispatch(function); - } + [ + [[link asio.reference.as_tuple_t.as_default_on [*as_default_on]] [static]] + [Function helper to adapt an I/O object to use as_tuple_t as its default completion token type. ] + ] + + [ + [[link asio.reference.as_tuple_t.as_tuple_t [*as_tuple_t]] [constructor]] + [Default constructor. + [hr] + Constructor. ] + ] + +] +[heading Data Members] +[table + [[Name][Description]] + [ + [[link asio.reference.as_tuple_t.token_ [*token_]]] + [] + ] +] +The [link asio.reference.as_tuple_t `as_tuple_t`] class is used to indicate that any arguments to the completion handler should be combined and passed as a single tuple argument. The arguments are first moved into a `std::tuple` and that tuple is then passed to the completion handler. [heading Requirements] -['Header: ][^asio/handler_invoke_hook.hpp] +['Header: ][^asio/as_tuple.hpp] ['Convenience header: ][^asio.hpp] -[section:overload1 asio_handler_invoke (1 of 2 overloads)] - - -Default handler invocation hook used for non-const function objects. - - - template< - typename Function> - asio_handler_invoke_is_deprecated asio_handler_invoke( - Function & function, - ... ); - - - [endsect] -[section:overload2 asio_handler_invoke (2 of 2 overloads)] - +[section:executor_with_default as_tuple_t::executor_with_default::executor_with_default] -Default handler invocation hook used for const function objects. +[indexterm2 asio.indexterm.as_tuple_t__executor_with_default.executor_with_default..executor_with_default..as_tuple_t::executor_with_default] +Construct the adapted executor from the inner executor type. template< - typename Function> - asio_handler_invoke_is_deprecated asio_handler_invoke( - const Function & function, - ... ); + typename ``[link asio.reference.Executor1 InnerExecutor1]``> + executor_with_default( + const InnerExecutor1 & ex, + constraint_t< conditional_t< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::value > = 0); [endsect] + [endsect] @@ -4607,12 +4651,12 @@ The default implementation of the continuation hook returns `false`. - class my_handler; + class my_handler; - bool asio_handler_is_continuation(my_handler* context) - { - return true; - } + bool asio_handler_is_continuation(my_handler* context) + { + return true; + } @@ -4661,7 +4705,7 @@ Traits type used to obtain the allocator associated with an object. [[Name][Description]] [ - [[link asio.reference.associated_allocator.decltype [*decltype]] [static]] + [[link asio.reference.associated_allocator.get [*get]] [static]] [If T has a nested type allocator_type, returns t.get_allocator(). Otherwise returns type(). [hr] If T has a nested type allocator_type, returns t.get_allocator(). Otherwise returns a. ] @@ -4669,17 +4713,6 @@ Traits type used to obtain the allocator associated with an object. ] -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.associated_allocator.noexcept [*noexcept]]] - [] - ] - -] - 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`. @@ -4701,33 +4734,34 @@ Specialisations shall meet the following requirements, where `t` is a const refe ['Convenience header: ][^asio.hpp] -[section:decltype associated_allocator::decltype] +[section:get associated_allocator::get] -[indexterm2 asio.indexterm.associated_allocator.decltype..decltype..associated_allocator] +[indexterm2 asio.indexterm.associated_allocator.get..get..associated_allocator] If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwise returns `type()`. - static static ``[link asio.reference.associated_allocator.decltype.overload1 decltype]``( - auto ) const; - `` [''''»''' [link asio.reference.associated_allocator.decltype.overload1 more...]]`` + static decltype(auto) ``[link asio.reference.associated_allocator.get.overload1 get]``( + const T & t); + `` [''''»''' [link asio.reference.associated_allocator.get.overload1 more...]]`` If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwise returns `a`. - static static ``[link asio.reference.associated_allocator.decltype.overload2 decltype]``( - auto ) const; - `` [''''»''' [link asio.reference.associated_allocator.decltype.overload2 more...]]`` + static decltype(auto) ``[link asio.reference.associated_allocator.get.overload2 get]``( + const T & t, + const Allocator & a); + `` [''''»''' [link asio.reference.associated_allocator.get.overload2 more...]]`` -[section:overload1 associated_allocator::decltype (1 of 2 overloads)] +[section:overload1 associated_allocator::get (1 of 2 overloads)] If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwise returns `type()`. - static static decltype( - auto ) const; + static decltype(auto) get( + const T & t); @@ -4735,14 +4769,15 @@ If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwis -[section:overload2 associated_allocator::decltype (2 of 2 overloads)] +[section:overload2 associated_allocator::get (2 of 2 overloads)] If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwise returns `a`. - static static decltype( - auto ) const; + static decltype(auto) get( + const T & t, + const Allocator & a); @@ -4752,18 +4787,6 @@ If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwis [endsect] -[section:noexcept associated_allocator::noexcept] - -[indexterm2 asio.indexterm.associated_allocator.noexcept..noexcept..associated_allocator] - - const Allocator &a noexcept; - - - -[endsect] - - - [section:type associated_allocator::type] [indexterm2 asio.indexterm.associated_allocator.type..type..associated_allocator] @@ -4907,7 +4930,7 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. [[Name][Description]] [ - [[link asio.reference.associated_allocator.decltype [*decltype]] [static]] + [[link asio.reference.associated_allocator.get [*get]] [static]] [If T has a nested type allocator_type, returns t.get_allocator(). Otherwise returns type(). [hr] If T has a nested type allocator_type, returns t.get_allocator(). Otherwise returns a. ] @@ -4915,17 +4938,70 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. ] -[heading Data Members] +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` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,a)` and with return type `type` or a (possibly const) reference to `type`. + + + + +[heading Requirements] + +['Header: ][^asio/associated_allocator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + + +[section:associated_allocator_t associated_allocator_t] + +[indexterm1 asio.indexterm.associated_allocator_t..associated_allocator_t] + + + typedef typename associated_allocator< T, Allocator >::type associated_allocator_t; + + +[heading Types] [table [[Name][Description]] [ - [[link asio.reference.associated_allocator.noexcept [*noexcept]]] - [] + + [[link asio.reference.associated_allocator.type [*type]]] + [If T has a nested type allocator_type, T::allocator_type. Otherwise Allocator. ] + ] ] +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.associated_allocator.get [*get]] [static]] + [If T has a nested type allocator_type, returns t.get_allocator(). Otherwise returns type(). + [hr] + 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`. @@ -4952,9 +5028,6 @@ Specialisations shall meet the following requirements, where `t` is a const refe [endsect] - -[endsect] - [section:associated_cancellation_slot associated_cancellation_slot] [indexterm1 asio.indexterm.associated_cancellation_slot..associated_cancellation_slot] @@ -4987,7 +5060,7 @@ Traits type used to obtain the [link asio.reference.cancellation_slot `cancellat [[Name][Description]] [ - [[link asio.reference.associated_cancellation_slot.decltype [*decltype]] [static]] + [[link asio.reference.associated_cancellation_slot.get [*get]] [static]] [If T has a nested type cancellation_slot_type, returns t.get_cancellation_slot(). Otherwise returns type(). [hr] If T has a nested type cancellation_slot_type, returns t.get_cancellation_slot(). Otherwise returns s. ] @@ -4995,17 +5068,6 @@ Traits type used to obtain the [link asio.reference.cancellation_slot `cancellat ] -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.associated_cancellation_slot.noexcept [*noexcept]]] - [] - ] - -] - A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `CancellationSlot` shall be a type meeting the CancellationSlot requirements. Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `s` is an object of type `CancellationSlot`. @@ -5027,33 +5089,34 @@ Specialisations shall meet the following requirements, where `t` is a const refe ['Convenience header: ][^asio.hpp] -[section:decltype associated_cancellation_slot::decltype] +[section:get associated_cancellation_slot::get] -[indexterm2 asio.indexterm.associated_cancellation_slot.decltype..decltype..associated_cancellation_slot] +[indexterm2 asio.indexterm.associated_cancellation_slot.get..get..associated_cancellation_slot] If `T` has a nested type `cancellation_slot_type`, returns `t.get_cancellation_slot()`. Otherwise returns `type()`. - static static ``[link asio.reference.associated_cancellation_slot.decltype.overload1 decltype]``( - auto ) const; - `` [''''»''' [link asio.reference.associated_cancellation_slot.decltype.overload1 more...]]`` + static decltype(auto) ``[link asio.reference.associated_cancellation_slot.get.overload1 get]``( + const T & t); + `` [''''»''' [link asio.reference.associated_cancellation_slot.get.overload1 more...]]`` If `T` has a nested type `cancellation_slot_type`, returns `t.get_cancellation_slot()`. Otherwise returns `s`. - static static ``[link asio.reference.associated_cancellation_slot.decltype.overload2 decltype]``( - auto ) const; - `` [''''»''' [link asio.reference.associated_cancellation_slot.decltype.overload2 more...]]`` + static decltype(auto) ``[link asio.reference.associated_cancellation_slot.get.overload2 get]``( + const T & t, + const CancellationSlot & s); + `` [''''»''' [link asio.reference.associated_cancellation_slot.get.overload2 more...]]`` -[section:overload1 associated_cancellation_slot::decltype (1 of 2 overloads)] +[section:overload1 associated_cancellation_slot::get (1 of 2 overloads)] If `T` has a nested type `cancellation_slot_type`, returns `t.get_cancellation_slot()`. Otherwise returns `type()`. - static static decltype( - auto ) const; + static decltype(auto) get( + const T & t); @@ -5061,35 +5124,24 @@ If `T` has a nested type `cancellation_slot_type`, returns `t.get_cancellation_s -[section:overload2 associated_cancellation_slot::decltype (2 of 2 overloads)] +[section:overload2 associated_cancellation_slot::get (2 of 2 overloads)] If `T` has a nested type `cancellation_slot_type`, returns `t.get_cancellation_slot()`. Otherwise returns `s`. - static static decltype( - auto ) const; - - + static decltype(auto) get( + const T & t, + const CancellationSlot & s); -[endsect] [endsect] -[section:noexcept associated_cancellation_slot::noexcept] - -[indexterm2 asio.indexterm.associated_cancellation_slot.noexcept..noexcept..associated_cancellation_slot] - - const CancellationSlot &s noexcept; - - - [endsect] - [section:type associated_cancellation_slot::type] [indexterm2 asio.indexterm.associated_cancellation_slot.type..type..associated_cancellation_slot] @@ -5233,7 +5285,7 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. [[Name][Description]] [ - [[link asio.reference.associated_cancellation_slot.decltype [*decltype]] [static]] + [[link asio.reference.associated_cancellation_slot.get [*get]] [static]] [If T has a nested type cancellation_slot_type, returns t.get_cancellation_slot(). Otherwise returns type(). [hr] If T has a nested type cancellation_slot_type, returns t.get_cancellation_slot(). Otherwise returns s. ] @@ -5241,17 +5293,70 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. ] -[heading Data Members] +A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `CancellationSlot` shall be a type meeting the CancellationSlot requirements. + +Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `s` is an object of type `CancellationSlot`. + + +* Provide a nested typedef `type` that identifies a type meeting the CancellationSlot requirements. + + +* Provide a noexcept static member function named `get`, callable as `get(t)` and with return type `type` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,s)` and with return type `type` or a (possibly const) reference to `type`. + + + + +[heading Requirements] + +['Header: ][^asio/associated_cancellation_slot.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + + +[section:associated_cancellation_slot_t associated_cancellation_slot_t] + +[indexterm1 asio.indexterm.associated_cancellation_slot_t..associated_cancellation_slot_t] + + + typedef typename associated_cancellation_slot< T, CancellationSlot >::type associated_cancellation_slot_t; + + +[heading Types] [table [[Name][Description]] [ - [[link asio.reference.associated_cancellation_slot.noexcept [*noexcept]]] - [] + + [[link asio.reference.associated_cancellation_slot.type [*type]]] + [If T has a nested type cancellation_slot_type, T::cancellation_slot_type. Otherwise CancellationSlot. ] + ] ] +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.associated_cancellation_slot.get [*get]] [static]] + [If T has a nested type cancellation_slot_type, returns t.get_cancellation_slot(). Otherwise returns type(). + [hr] + If T has a nested type cancellation_slot_type, returns t.get_cancellation_slot(). Otherwise returns s. ] + ] + +] + A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `CancellationSlot` shall be a type meeting the CancellationSlot requirements. Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `s` is an object of type `CancellationSlot`. @@ -5278,9 +5383,6 @@ Specialisations shall meet the following requirements, where `t` is a const refe [endsect] - -[endsect] - [section:associated_executor associated_executor] [indexterm1 asio.indexterm.associated_executor..associated_executor] @@ -5313,7 +5415,7 @@ Traits type used to obtain the executor associated with an object. [[Name][Description]] [ - [[link asio.reference.associated_executor.decltype [*decltype]] [static]] + [[link asio.reference.associated_executor.get [*get]] [static]] [If T has a nested type executor_type, returns t.get_executor(). Otherwise returns type(). [hr] If T has a nested type executor_type, returns t.get_executor(). Otherwise returns ex. ] @@ -5321,17 +5423,6 @@ Traits type used to obtain the executor associated with an object. ] -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.associated_executor.noexcept [*noexcept]]] - [] - ] - -] - 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`. @@ -5353,33 +5444,34 @@ Specialisations shall meet the following requirements, where `t` is a const refe ['Convenience header: ][^asio.hpp] -[section:decltype associated_executor::decltype] +[section:get associated_executor::get] -[indexterm2 asio.indexterm.associated_executor.decltype..decltype..associated_executor] +[indexterm2 asio.indexterm.associated_executor.get..get..associated_executor] If `T` has a nested type `executor_type`, returns `t.get_executor()`. Otherwise returns `type()`. - static static ``[link asio.reference.associated_executor.decltype.overload1 decltype]``( - auto ) const; - `` [''''»''' [link asio.reference.associated_executor.decltype.overload1 more...]]`` + static decltype(auto) ``[link asio.reference.associated_executor.get.overload1 get]``( + const T & t); + `` [''''»''' [link asio.reference.associated_executor.get.overload1 more...]]`` If `T` has a nested type `executor_type`, returns `t.get_executor()`. Otherwise returns `ex`. - static static ``[link asio.reference.associated_executor.decltype.overload2 decltype]``( - auto ) const; - `` [''''»''' [link asio.reference.associated_executor.decltype.overload2 more...]]`` + static decltype(auto) ``[link asio.reference.associated_executor.get.overload2 get]``( + const T & t, + const Executor & ex); + `` [''''»''' [link asio.reference.associated_executor.get.overload2 more...]]`` -[section:overload1 associated_executor::decltype (1 of 2 overloads)] +[section:overload1 associated_executor::get (1 of 2 overloads)] If `T` has a nested type `executor_type`, returns `t.get_executor()`. Otherwise returns `type()`. - static static decltype( - auto ) const; + static decltype(auto) get( + const T & t); @@ -5387,35 +5479,24 @@ If `T` has a nested type `executor_type`, returns `t.get_executor()`. Otherwise -[section:overload2 associated_executor::decltype (2 of 2 overloads)] +[section:overload2 associated_executor::get (2 of 2 overloads)] If `T` has a nested type `executor_type`, returns `t.get_executor()`. Otherwise returns `ex`. - static static decltype( - auto ) const; - - + static decltype(auto) get( + const T & t, + const Executor & ex); -[endsect] [endsect] -[section:noexcept associated_executor::noexcept] - -[indexterm2 asio.indexterm.associated_executor.noexcept..noexcept..associated_executor] - - const Executor &ex noexcept; - - - [endsect] - [section:type associated_executor::type] [indexterm2 asio.indexterm.associated_executor.type..type..associated_executor] @@ -5559,7 +5640,7 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. [[Name][Description]] [ - [[link asio.reference.associated_executor.decltype [*decltype]] [static]] + [[link asio.reference.associated_executor.get [*get]] [static]] [If T has a nested type executor_type, returns t.get_executor(). Otherwise returns type(). [hr] If T has a nested type executor_type, returns t.get_executor(). Otherwise returns ex. ] @@ -5567,17 +5648,70 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. ] -[heading Data Members] +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` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type` or a (possibly const) reference to `type`. + + + + +[heading Requirements] + +['Header: ][^asio/associated_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + + +[section:associated_executor_t associated_executor_t] + +[indexterm1 asio.indexterm.associated_executor_t..associated_executor_t] + + + typedef typename associated_executor< T, Executor >::type associated_executor_t; + + +[heading Types] [table [[Name][Description]] [ - [[link asio.reference.associated_executor.noexcept [*noexcept]]] - [] + + [[link asio.reference.associated_executor.type [*type]]] + [If T has a nested type executor_type, T::executor_type. Otherwise Executor. ] + ] ] +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.associated_executor.get [*get]] [static]] + [If T has a nested type executor_type, returns t.get_executor(). Otherwise returns type(). + [hr] + 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`. @@ -5604,9 +5738,6 @@ Specialisations shall meet the following requirements, where `t` is a const refe [endsect] - -[endsect] - [section:associated_immediate_executor associated_immediate_executor] [indexterm1 asio.indexterm.associated_immediate_executor..associated_immediate_executor] @@ -5639,23 +5770,12 @@ Traits type used to obtain the immediate executor associated with an object. [[Name][Description]] [ - [[link asio.reference.associated_immediate_executor.decltype [*decltype]] [static]] + [[link asio.reference.associated_immediate_executor.get [*get]] [static]] [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns asio::require(ex, asio::execution::blocking.never). ] ] ] -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.associated_immediate_executor.noexcept [*noexcept]]] - [] - ] - -] - 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`. @@ -5678,26 +5798,15 @@ Specialisations shall meet the following requirements, where `t` is a const refe ['Convenience header: ][^asio.hpp] -[section:decltype associated_immediate_executor::decltype] +[section:get associated_immediate_executor::get] -[indexterm2 asio.indexterm.associated_immediate_executor.decltype..decltype..associated_immediate_executor] +[indexterm2 asio.indexterm.associated_immediate_executor.get..get..associated_immediate_executor] If `T` has a nested type `immediate_executor_type`, returns `t.get_immediate_executor()`. Otherwise returns `asio::require(ex, asio::execution::blocking.never)`. - static static decltype( - auto ) const; - - - -[endsect] - - - -[section:noexcept associated_immediate_executor::noexcept] - -[indexterm2 asio.indexterm.associated_immediate_executor.noexcept..noexcept..associated_immediate_executor] - - const Executor &ex noexcept; + static decltype(auto) get( + const T & t, + const Executor & ex); @@ -5816,23 +5925,74 @@ Forwards `type` to the associator specialisation for the unwrapped type `T`. [[Name][Description]] [ - [[link asio.reference.associated_immediate_executor.decltype [*decltype]] [static]] + [[link asio.reference.associated_immediate_executor.get [*get]] [static]] [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns asio::require(ex, asio::execution::blocking.never). ] ] ] -[heading Data Members] +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` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type` or a (possibly const) reference to `type`. + + + + +[heading Requirements] + +['Header: ][^asio/associated_immediate_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + + +[section:associated_immediate_executor_t associated_immediate_executor_t] + +[indexterm1 asio.indexterm.associated_immediate_executor_t..associated_immediate_executor_t] + + + typedef typename associated_immediate_executor< T, Executor >::type associated_immediate_executor_t; + + +[heading Types] [table [[Name][Description]] [ - [[link asio.reference.associated_immediate_executor.noexcept [*noexcept]]] - [] + + [[link asio.reference.associated_immediate_executor.type [*type]]] + [If T has a nested type immediate_executor_type,. ] + ] ] +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.associated_immediate_executor.get [*get]] [static]] + [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns asio::require(ex, asio::execution::blocking.never). ] + ] + +] + 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`. @@ -5859,9 +6019,6 @@ Specialisations shall meet the following requirements, where `t` is a const refe [endsect] - -[endsect] - [section:associator associator] [indexterm1 asio.indexterm.associator..associator] @@ -5970,7 +6127,7 @@ The constructor creates the concrete completion handler and makes the link betwe 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; + conditional_t< is_same< CompletionToken, completion_handler_type >::value, completion_handler_type &, completion_handler_type > completion_handler; @@ -5984,7 +6141,7 @@ A copy of, or reference to, a real handler object. The real handler type to be used for the asynchronous operation. - typedef asio::async_result< typename decay< CompletionToken >::type, Signatures... >::completion_handler_type completion_handler_type; + typedef asio::async_result< decay_t< CompletionToken >, Signatures... >::completion_handler_type completion_handler_type; [heading Types] @@ -6061,7 +6218,7 @@ This template may be specialised for user-defined completion token types. The pr The result of the asynchronous operation's initiating function. - async_result< typename decay< CompletionToken >::type, Signatures... > result; + async_result< decay_t< CompletionToken >, Signatures... > result; @@ -6084,9 +6241,9 @@ Launch an asynchronous operation with a stateful implementation. typename Signature, typename Implementation, typename... IoObjectsOrExecutors> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_compose( + auto async_compose( Implementation && implementation, - CompletionToken & token, + type_identity_t< CompletionToken > & token, IoObjectsOrExecutors &&... io_objects_or_executors); @@ -6119,59 +6276,59 @@ By default, terminal per-operation cancellation is enabled for composed operatio 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; - } - } - }; + { + 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) -> - decltype( - asio::async_compose( - std::declval(), - token, socket)) - { - return asio::async_compose( - async_echo_implementation{socket, buffer, - async_echo_implementation::starting}, - token, socket); - } + template + auto async_echo(tcp::socket& socket, + asio::mutable_buffer buffer, + CompletionToken&& token) -> + decltype( + asio::async_compose( + std::declval(), + token, socket)) + { + return asio::async_compose( + async_echo_implementation{socket, buffer, + async_echo_implementation::starting}, + token, socket); + } @@ -6199,12 +6356,12 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.Executor1 Executor]``, typename ``[link asio.reference.EndpointSequence EndpointSequence]``, - typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_connect.overload1 async_connect]``( + typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_connect.overload1 async_connect]``( basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, - RangeConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + RangeConnectToken && token = default_completion_token_t< Executor >(), + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 0); `` [''''»''' [link asio.reference.async_connect.overload1 more...]]`` (Deprecated: Use range overload.) Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -6213,12 +6370,12 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_connect.overload2 async_connect]``( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_connect.overload2 async_connect]``( basic_socket< Protocol, Executor > & s, Iterator begin, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint::value >::type = 0); + IteratorConnectToken && token = default_completion_token_t< Executor >(), + constraint_t::value > = 0); `` [''''»''' [link asio.reference.async_connect.overload2 more...]]`` Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -6227,12 +6384,12 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_connect.overload3 async_connect]``( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_connect.overload3 async_connect]``( basic_socket< Protocol, Executor > & s, Iterator begin, Iterator end, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + IteratorConnectToken && token = default_completion_token_t< Executor >()); `` [''''»''' [link asio.reference.async_connect.overload3 more...]]`` template< @@ -6240,13 +6397,13 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Executor1 Executor]``, typename ``[link asio.reference.EndpointSequence EndpointSequence]``, typename ``[link asio.reference.ConnectCondition ConnectCondition]``, - typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_connect.overload4 async_connect]``( + typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_connect.overload4 async_connect]``( basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, ConnectCondition connect_condition, - RangeConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + RangeConnectToken && token = default_completion_token_t< Executor >(), + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 0); `` [''''»''' [link asio.reference.async_connect.overload4 more...]]`` (Deprecated: Use range overload.) Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -6256,13 +6413,13 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, typename ``[link asio.reference.ConnectCondition ConnectCondition]``, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_connect.overload5 async_connect]``( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_connect.overload5 async_connect]``( basic_socket< Protocol, Executor > & s, Iterator begin, ConnectCondition connect_condition, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint::value >::type = 0); + IteratorConnectToken && token = default_completion_token_t< Executor >(), + constraint_t::value > = 0); `` [''''»''' [link asio.reference.async_connect.overload5 more...]]`` Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -6272,18 +6429,18 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, typename ``[link asio.reference.ConnectCondition ConnectCondition]``, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_connect.overload6 async_connect]``( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_connect.overload6 async_connect]``( basic_socket< Protocol, Executor > & s, Iterator begin, Iterator end, ConnectCondition connect_condition, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + IteratorConnectToken && token = default_completion_token_t< Executor >()); `` [''''»''' [link asio.reference.async_connect.overload6 more...]]`` [heading Requirements] -['Header: ][^asio/connect.hpp] +['Header: ][^asio/impl/connect.hpp] ['Convenience header: ][^asio.hpp] @@ -6298,12 +6455,12 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.Executor1 Executor]``, typename ``[link asio.reference.EndpointSequence EndpointSequence]``, - typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = default_completion_token_t> + auto async_connect( basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, - RangeConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + RangeConnectToken && token = default_completion_token_t< Executor >(), + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -6321,15 +6478,15 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -6340,7 +6497,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, typename Protocol::endpoint) + void(asio::error_code, typename Protocol::endpoint) @@ -6351,33 +6508,33 @@ Regardless of whether the asynchronous operation completes immediately or not, t tcp::resolver r(my_context); - tcp::resolver::query q("host", "service"); - tcp::socket s(my_context); + tcp::resolver::query q("host", "service"); + tcp::socket s(my_context); - // ... + // ... - r.async_resolve(q, resolve_handler); + 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 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) - { - // ... - } + void connect_handler( + const asio::error_code& ec, + const tcp::endpoint& endpoint) + { + // ... + } @@ -6410,12 +6567,12 @@ if they are also supported by the socket's `async_connect` operation. typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto async_connect( basic_socket< Protocol, Executor > & s, Iterator begin, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint::value >::type = 0); + IteratorConnectToken && token = default_completion_token_t< Executor >(), + constraint_t::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -6433,15 +6590,15 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -6452,7 +6609,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, Iterator) + void(asio::error_code, Iterator) @@ -6490,12 +6647,12 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto async_connect( basic_socket< Protocol, Executor > & s, Iterator begin, Iterator end, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + IteratorConnectToken && token = default_completion_token_t< Executor >()); 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -6515,15 +6672,15 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -6534,7 +6691,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, Iterator) + void(asio::error_code, Iterator) @@ -6545,19 +6702,19 @@ Regardless of whether the asynchronous operation completes immediately or not, t std::vector endpoints = ...; - tcp::socket s(my_context); - asio::async_connect(s, - endpoints.begin(), endpoints.end(), - connect_handler); + 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) - { - // ... - } + void connect_handler( + const asio::error_code& ec, + std::vector::iterator i) + { + // ... + } @@ -6591,13 +6748,13 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Executor1 Executor]``, typename ``[link asio.reference.EndpointSequence EndpointSequence]``, typename ``[link asio.reference.ConnectCondition ConnectCondition]``, - typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.RangeConnectToken RangeConnectToken]`` = default_completion_token_t> + auto async_connect( basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, ConnectCondition connect_condition, - RangeConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + RangeConnectToken && token = default_completion_token_t< Executor >(), + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -6614,24 +6771,24 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -6642,7 +6799,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, typename Protocol::endpoint) + void(asio::error_code, typename Protocol::endpoint) @@ -6653,57 +6810,57 @@ Regardless of whether the asynchronous operation completes immediately or not, t 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; - } - }; + { + 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: +It would be used with the [link asio.reference.connect `connect`] function as follows: tcp::resolver r(my_context); - tcp::resolver::query q("host", "service"); - tcp::socket s(my_context); - - // ... + tcp::resolver::query q("host", "service"); + tcp::socket s(my_context); - r.async_resolve(q, resolve_handler); + // ... - // ... + 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; - } - } + 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; + } + } @@ -6737,13 +6894,13 @@ if they are also supported by the socket's `async_connect` operation. typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, typename ``[link asio.reference.ConnectCondition ConnectCondition]``, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto async_connect( basic_socket< Protocol, Executor > & s, Iterator begin, ConnectCondition connect_condition, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint::value >::type = 0); + IteratorConnectToken && token = default_completion_token_t< Executor >(), + constraint_t::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -6760,24 +6917,24 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -6788,7 +6945,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, Iterator) + void(asio::error_code, Iterator) @@ -6827,13 +6984,13 @@ Asynchronously establishes a socket connection by trying each endpoint in a sequ typename ``[link asio.reference.Executor1 Executor]``, typename Iterator, typename ``[link asio.reference.ConnectCondition ConnectCondition]``, - typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.IteratorConnectToken IteratorConnectToken]`` = default_completion_token_t> + auto async_connect( basic_socket< Protocol, Executor > & s, Iterator begin, Iterator end, ConnectCondition connect_condition, - IteratorConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + IteratorConnectToken && token = default_completion_token_t< Executor >()); 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -6852,24 +7009,24 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -6880,7 +7037,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, Iterator) + void(asio::error_code, Iterator) @@ -6891,58 +7048,58 @@ Regardless of whether the asynchronous operation completes immediately or not, t 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; - } - }; + { + 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: +It would be used with the [link asio.reference.connect `connect`] function as follows: tcp::resolver r(my_context); - tcp::resolver::query q("host", "service"); - tcp::socket s(my_context); - - // ... + tcp::resolver::query q("host", "service"); + tcp::socket s(my_context); - r.async_resolve(q, resolve_handler); + // ... - // ... + 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; - } - } + 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; + } + } @@ -6979,7 +7136,7 @@ if they are also supported by the socket's `async_connect` operation. typename... Args> ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_initiate( Initiation && initiation, - CompletionToken & , + type_identity_t< CompletionToken > & token, Args &&... args); @@ -7005,102 +7162,102 @@ Start an asynchronous operation to read a certain amount of data from a stream. template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload1 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload1 async_read]``( AsyncReadStream & s, const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.async_read.overload1 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload2 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload2 async_read]``( AsyncReadStream & s, const MutableBufferSequence & buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.async_read.overload2 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload3 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload3 async_read]``( AsyncReadStream & s, DynamicBuffer_v1 && buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_read.overload3 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload4 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload4 async_read]``( AsyncReadStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_read.overload4 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload5 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload5 async_read]``( AsyncReadStream & s, basic_streambuf< Allocator > & b, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); `` [''''»''' [link asio.reference.async_read.overload5 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload6 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload6 async_read]``( AsyncReadStream & s, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); `` [''''»''' [link asio.reference.async_read.overload6 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload7 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload7 async_read]``( AsyncReadStream & s, DynamicBuffer_v2 buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_read.overload7 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read.overload8 async_read]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read.overload8 async_read]``( AsyncReadStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_read.overload8 more...]]`` [heading Requirements] -['Header: ][^asio/read.hpp] +['Header: ][^asio/impl/read.hpp] ['Convenience header: ][^asio.hpp] @@ -7114,12 +7271,12 @@ Start an asynchronous operation to read a certain amount of data from a stream. template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7145,14 +7302,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7163,7 +7320,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7173,7 +7330,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_read(s, asio::buffer(data, size), handler); + asio::async_read(s, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -7183,10 +7340,10 @@ See the [link asio.reference.buffer `buffer`] documentation for information on r This overload is equivalent to calling: - asio::async_read( - s, buffers, - asio::transfer_all(), - handler); + asio::async_read( + s, buffers, + asio::transfer_all(), + handler); @@ -7219,13 +7376,13 @@ Start an asynchronous operation to read a certain amount of data from a stream. typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, const MutableBufferSequence & buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7249,26 +7406,26 @@ This function is used to asynchronously read a certain number of bytes of data f [[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, + // Result of latest async_read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7279,7 +7436,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7289,10 +7446,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_read(s, - asio::buffer(data, size), - asio::transfer_at_least(32), - handler); + asio::async_read(s, + asio::buffer(data, size), + asio::transfer_at_least(32), + handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -7324,13 +7481,13 @@ Start an asynchronous operation to read a certain amount of data from a stream. template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, DynamicBuffer_v1 && buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7356,14 +7513,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7374,7 +7531,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7384,10 +7541,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t This overload is equivalent to calling: - asio::async_read( - s, buffers, - asio::transfer_all(), - handler); + asio::async_read( + s, buffers, + asio::transfer_all(), + handler); @@ -7420,14 +7577,14 @@ Start an asynchronous operation to read a certain amount of data from a stream. typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7453,26 +7610,26 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7483,7 +7640,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7515,11 +7672,11 @@ Start an asynchronous operation to read a certain amount of data from a stream. template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, basic_streambuf< Allocator > & b, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7545,14 +7702,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7563,7 +7720,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7573,10 +7730,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t This overload is equivalent to calling: - asio::async_read( - s, b, - asio::transfer_all(), - handler); + asio::async_read( + s, b, + asio::transfer_all(), + handler); @@ -7609,12 +7766,12 @@ Start an asynchronous operation to read a certain amount of data from a stream. typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7640,26 +7797,26 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7670,7 +7827,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7702,12 +7859,12 @@ Start an asynchronous operation to read a certain amount of data from a stream. template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, DynamicBuffer_v2 buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7733,14 +7890,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7751,7 +7908,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7761,10 +7918,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t This overload is equivalent to calling: - asio::async_read( - s, buffers, - asio::transfer_all(), - handler); + asio::async_read( + s, buffers, + asio::transfer_all(), + handler); @@ -7797,13 +7954,13 @@ Start an asynchronous operation to read a certain amount of data from a stream. typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read( AsyncReadStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); This function is used to asynchronously read a certain number of bytes of data from a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7829,26 +7986,26 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -7859,7 +8016,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -7895,54 +8052,54 @@ Start an asynchronous operation to read a certain amount of data at the specifie template< typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_at.overload1 async_read_at]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto ``[link asio.reference.async_read_at.overload1 async_read_at]``( AsyncRandomAccessReadDevice & d, uint64_t offset, const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); `` [''''»''' [link asio.reference.async_read_at.overload1 more...]]`` template< typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_at.overload2 async_read_at]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto ``[link asio.reference.async_read_at.overload2 async_read_at]``( AsyncRandomAccessReadDevice & d, uint64_t offset, const MutableBufferSequence & buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); `` [''''»''' [link asio.reference.async_read_at.overload2 more...]]`` template< typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_at.overload3 async_read_at]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto ``[link asio.reference.async_read_at.overload3 async_read_at]``( AsyncRandomAccessReadDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); `` [''''»''' [link asio.reference.async_read_at.overload3 more...]]`` template< typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_at.overload4 async_read_at]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto ``[link asio.reference.async_read_at.overload4 async_read_at]``( AsyncRandomAccessReadDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); `` [''''»''' [link asio.reference.async_read_at.overload4 more...]]`` [heading Requirements] -['Header: ][^asio/read_at.hpp] +['Header: ][^asio/impl/read_at.hpp] ['Convenience header: ][^asio.hpp] @@ -7956,12 +8113,12 @@ Start an asynchronous operation to read a certain amount of data at the specifie template< typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_at( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto async_read_at( AsyncRandomAccessReadDevice & d, uint64_t offset, const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -7989,14 +8146,14 @@ This operation is implemented in terms of zero or more calls to the device's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -8007,7 +8164,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8017,7 +8174,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_read_at(d, 42, asio::buffer(data, size), handler); + asio::async_read_at(d, 42, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -8027,10 +8184,10 @@ See the [link asio.reference.buffer `buffer`] documentation for information on r This overload is equivalent to calling: - asio::async_read_at( - d, 42, buffers, - asio::transfer_all(), - handler); + asio::async_read_at( + d, 42, buffers, + asio::transfer_all(), + handler); @@ -8063,13 +8220,13 @@ Start an asynchronous operation to read a certain amount of data at the specifie typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_at( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto async_read_at( AsyncRandomAccessReadDevice & d, uint64_t offset, const MutableBufferSequence & buffers, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8095,26 +8252,26 @@ This function is used to asynchronously read a certain number of bytes of data f [[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, + // Result of latest async_read_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -8125,7 +8282,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8135,10 +8292,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_read_at(d, 42, - asio::buffer(data, size), - asio::transfer_at_least(32), - handler); + asio::async_read_at(d, 42, + asio::buffer(data, size), + asio::transfer_at_least(32), + handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -8170,12 +8327,12 @@ Start an asynchronous operation to read a certain amount of data at the specifie template< typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_at( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto async_read_at( AsyncRandomAccessReadDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8200,14 +8357,14 @@ This operation is implemented in terms of zero or more calls to the device's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -8218,7 +8375,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8228,10 +8385,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t This overload is equivalent to calling: - asio::async_read_at( - d, 42, b, - asio::transfer_all(), - handler); + asio::async_read_at( + d, 42, b, + asio::transfer_all(), + handler); @@ -8264,13 +8421,13 @@ Start an asynchronous operation to read a certain amount of data at the specifie typename ``[link asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``, typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_at( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type>> + auto async_read_at( AsyncRandomAccessReadDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncRandomAccessReadDevice::executor_type >()); This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8295,26 +8452,26 @@ This operation is implemented in terms of zero or more calls to the device's asy [[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, + // Result of latest async_read_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -8325,7 +8482,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8361,27 +8518,27 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload1 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload1 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v1 && buffers, char delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload1 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload2 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload2 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v1 && buffers, string_view delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload2 more...]]`` Start an asynchronous operation to read data into a dynamic buffer sequence until some part of its data matches a regular expression. @@ -8389,14 +8546,15 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload3 async_read_until]``( + typename Traits, + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload3 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v1 && buffers, - const boost::regex & expr, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload3 more...]]`` Start an asynchronous operation to read data into a dynamic buffer sequence until a function object indicates a match. @@ -8405,15 +8563,15 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, typename MatchCondition, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload4 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload4 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v1 && buffers, MatchCondition match_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload4 more...]]`` Start an asynchronous operation to read data into a streambuf until it contains a specified delimiter. @@ -8421,23 +8579,23 @@ Start an asynchronous operation to read data into a streambuf until it contains template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload5 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload5 async_read_until]``( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, char delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); `` [''''»''' [link asio.reference.async_read_until.overload5 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload6 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload6 async_read_until]``( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, string_view delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); `` [''''»''' [link asio.reference.async_read_until.overload6 more...]]`` Start an asynchronous operation to read data into a streambuf until some part of its data matches a regular expression. @@ -8445,12 +8603,13 @@ Start an asynchronous operation to read data into a streambuf until some part of template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload7 async_read_until]``( + typename Traits, + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload7 async_read_until]``( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, - const boost::regex & expr, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + const boost::basic_regex< char, Traits > & expr, + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); `` [''''»''' [link asio.reference.async_read_until.overload7 more...]]`` Start an asynchronous operation to read data into a streambuf until a function object indicates a match. @@ -8459,13 +8618,13 @@ Start an asynchronous operation to read data into a streambuf until a function o typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, typename MatchCondition, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload8 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload8 async_read_until]``( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, MatchCondition match_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_match_condition< MatchCondition >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload8 more...]]`` Start an asynchronous operation to read data into a dynamic buffer sequence until it contains a specified delimiter. @@ -8473,25 +8632,25 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload9 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload9 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v2 buffers, char delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload9 more...]]`` template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload10 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload10 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v2 buffers, string_view delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload10 more...]]`` Start an asynchronous operation to read data into a dynamic buffer sequence until some part of its data matches a regular expression. @@ -8499,13 +8658,14 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload11 async_read_until]``( + typename Traits, + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload11 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v2 buffers, - const boost::regex & expr, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload11 more...]]`` Start an asynchronous operation to read data into a dynamic buffer sequence until a function object indicates a match. @@ -8514,19 +8674,19 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, typename MatchCondition, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_read_until.overload12 async_read_until]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto ``[link asio.reference.async_read_until.overload12 async_read_until]``( AsyncReadStream & s, DynamicBuffer_v2 buffers, MatchCondition match_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_read_until.overload12 more...]]`` [heading Requirements] -['Header: ][^asio/read_until.hpp] +['Header: ][^asio/impl/read_until.hpp] ['Convenience header: ][^asio.hpp] @@ -8540,14 +8700,14 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v1 && buffers, char delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8575,13 +8735,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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. - std::size_t bytes_transferred - ); + // The number of bytes in the dynamic buffer sequence's + // get area up to and including the delimiter. + std::size_t bytes_transferred + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -8592,7 +8752,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8608,33 +8768,33 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\n' } After the call to `erase`, the remaining data is left in the buffer `data` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -8666,14 +8826,14 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v1 && buffers, string_view delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8701,13 +8861,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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. - std::size_t bytes_transferred - ); + // The number of bytes in the dynamic buffer sequence's + // get area up to and including the delimiter. + std::size_t bytes_transferred + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -8718,7 +8878,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8734,33 +8894,33 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the string `data` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -8792,14 +8952,15 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename Traits, + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v1 && buffers, - const boost::regex & expr, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8827,15 +8988,15 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -8846,7 +9007,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -8862,34 +9023,34 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the string `data` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -8922,15 +9083,15 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, typename MatchCondition, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v1 && buffers, MatchCondition match_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -8955,25 +9116,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator + buffers_iterator `` 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -8989,7 +9150,7 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9005,22 +9166,22 @@ The default implementation of the `is_match_condition` type trait evaluates to t To asynchronously read data into a `std::string` until whitespace is encountered: typedef asio::buffers_iterator< - asio::const_buffers_1> iterator; - - std::pair - 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); + asio::const_buffers_1> iterator; + + std::pair + 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); @@ -9028,34 +9189,34 @@ To asynchronously read data into a `std::string` until whitespace is encountered 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 - std::pair 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 - : 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); + { + public: + explicit match_char(char c) : c_(c) {} + + template + std::pair 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 + : 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); @@ -9087,12 +9248,12 @@ Start an asynchronous operation to read data into a streambuf until it contains template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, char delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); This function is used to asynchronously read data into the specified streambuf until the streambuf's get area contains the specified delimiter. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9120,14 +9281,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -9138,7 +9299,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9154,34 +9315,34 @@ After a successful async\_read\_until operation, the streambuf may contain addit 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c' } The remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -9213,12 +9374,12 @@ Start an asynchronous operation to read data into a streambuf until it contains template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, string_view delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); This function is used to asynchronously read data into the specified streambuf until the streambuf's get area contains the specified delimiter. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9246,14 +9407,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -9264,7 +9425,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9280,34 +9441,34 @@ After a successful async\_read\_until operation, the streambuf may contain addit 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r' } The remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -9339,12 +9500,13 @@ Start an asynchronous operation to read data into a streambuf until some part of template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename Traits, + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, - const boost::regex & expr, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + const boost::basic_regex< char, Traits > & expr, + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >()); 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9372,15 +9534,15 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -9391,7 +9553,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9407,34 +9569,34 @@ After a successful async\_read\_until operation, the streambuf may contain addit 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r' } The remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -9467,13 +9629,13 @@ Start an asynchronous operation to read data into a streambuf until a function o typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename Allocator, typename MatchCondition, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, asio::basic_streambuf< Allocator > & b, MatchCondition match_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_match_condition< MatchCondition >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9498,25 +9660,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator::const_buffers_type> + buffers_iterator::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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -9532,7 +9694,7 @@ After a successful async\_read\_until operation, the streambuf may contain addit - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9548,22 +9710,22 @@ The default implementation of the `is_match_condition` type trait evaluates to t To asynchronously read data into a streambuf until whitespace is encountered: typedef asio::buffers_iterator< - asio::streambuf::const_buffers_type> iterator; - - std::pair - 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); + asio::streambuf::const_buffers_type> iterator; + + std::pair + 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); @@ -9571,34 +9733,34 @@ To asynchronously read data into a streambuf until whitespace is encountered: 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 - std::pair 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 - : 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); + { + public: + explicit match_char(char c) : c_(c) {} + + template + std::pair 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 + : 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); @@ -9630,13 +9792,13 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v2 buffers, char delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9664,14 +9826,14 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -9682,7 +9844,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9698,33 +9860,33 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\n' } After the call to `erase`, the remaining data is left in the buffer `data` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -9756,13 +9918,13 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v2 buffers, string_view delim, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9790,13 +9952,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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. - std::size_t bytes_transferred - ); + // The number of bytes in the dynamic buffer sequence's + // get area up to and including the delimiter. + std::size_t bytes_transferred + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -9807,7 +9969,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9823,33 +9985,33 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the string `data` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -9881,13 +10043,14 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti template< typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename Traits, + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v2 buffers, - const boost::regex & expr, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -9915,15 +10078,15 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -9934,7 +10097,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -9950,34 +10113,34 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may 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); + ... + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the string `data` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `async_read_until` operation. @@ -10010,14 +10173,14 @@ Start an asynchronous operation to read data into a dynamic buffer sequence unti typename ``[link asio.reference.AsyncReadStream AsyncReadStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, typename MatchCondition, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_until( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t< typename AsyncReadStream::executor_type>> + auto async_read_until( AsyncReadStream & s, DynamicBuffer_v2 buffers, MatchCondition match_condition, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + ReadToken && token = default_completion_token_t< typename AsyncReadStream::executor_type >(), + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -10042,25 +10205,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator + buffers_iterator `` 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -10076,7 +10239,7 @@ After a successful async\_read\_until operation, the dynamic buffer sequence may - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -10092,22 +10255,22 @@ The default implementation of the `is_match_condition` type trait evaluates to t To asynchronously read data into a `std::string` until whitespace is encountered: typedef asio::buffers_iterator< - asio::const_buffers_1> iterator; - - std::pair - 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); + asio::const_buffers_1> iterator; + + std::pair + 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); @@ -10115,34 +10278,34 @@ To asynchronously read data into a `std::string` until whitespace is encountered 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 - std::pair 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 - : 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); + { + public: + explicit match_char(char c) : c_(c) {} + + template + std::pair 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 + : 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); @@ -10355,6 +10518,13 @@ The return type of the initiating function. [table [[Name][Description]] + [ + + [[link asio.reference.async_result_lt__basic_yield_context_lt__Executor__gt__comma__Signature__gt___suspend_with_helper [*async_result< basic_yield_context< Executor >, Signature >::suspend_with_helper]]] + [] + + ] + [ [[link asio.reference.async_result_lt__basic_yield_context_lt__Executor__gt__comma__Signature__gt_.handler_type [*handler_type]]] @@ -10413,10 +10583,12 @@ The return type of the initiating function. [indexterm2 asio.indexterm.async_result_lt__basic_yield_context_lt__Executor__gt__comma__Signature__gt_.initiate..initiate..async_result< basic_yield_context< Executor >, Signature >] template< - typename Initiation> + typename Initiation, + typename... InitArgs> static return_type initiate( - Initiation init, - const basic_yield_context< Executor > & yield); + Initiation && init, + const basic_yield_context< Executor > & yield, + InitArgs &&... init_args); @@ -10588,12 +10760,12 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload1 async_write]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_write.overload1 async_write]``( AsyncWriteStream & s, const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >(), + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.async_write.overload1 more...]]`` Start an asynchronous operation to write a certain amount of data to a stream. @@ -10603,12 +10775,12 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload2 async_write]``( + auto ``[link asio.reference.async_write.overload2 async_write]``( AsyncWriteStream & s, const ConstBufferSequence & buffers, CompletionCondition completion_condition, WriteToken && token, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.async_write.overload2 more...]]`` Start an asynchronous operation to write all of the supplied data to a stream. @@ -10616,13 +10788,13 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload3 async_write]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_write.overload3 async_write]``( AsyncWriteStream & s, DynamicBuffer_v1 && buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_write.overload3 more...]]`` Start an asynchronous operation to write a certain amount of data to a stream. @@ -10632,13 +10804,13 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload4 async_write]``( + auto ``[link asio.reference.async_write.overload4 async_write]``( AsyncWriteStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, WriteToken && token, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.async_write.overload4 more...]]`` Start an asynchronous operation to write all of the supplied data to a stream. @@ -10646,11 +10818,11 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename Allocator, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload5 async_write]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_write.overload5 async_write]``( AsyncWriteStream & s, basic_streambuf< Allocator > & b, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >()); `` [''''»''' [link asio.reference.async_write.overload5 more...]]`` Start an asynchronous operation to write a certain amount of data to a stream. @@ -10660,7 +10832,7 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload6 async_write]``( + auto ``[link asio.reference.async_write.overload6 async_write]``( AsyncWriteStream & s, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, @@ -10672,12 +10844,12 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload7 async_write]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.async_write.overload7 async_write]``( AsyncWriteStream & s, DynamicBuffer_v2 buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_write.overload7 more...]]`` Start an asynchronous operation to write a certain amount of data to a stream. @@ -10687,17 +10859,17 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write.overload8 async_write]``( + auto ``[link asio.reference.async_write.overload8 async_write]``( AsyncWriteStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, WriteToken && token, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.async_write.overload8 more...]]`` [heading Requirements] -['Header: ][^asio/write.hpp] +['Header: ][^asio/impl/write.hpp] ['Convenience header: ][^asio.hpp] @@ -10711,12 +10883,12 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write( AsyncWriteStream & s, const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >(), + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -10742,13 +10914,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -10759,7 +10931,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -10769,7 +10941,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_write(s, asio::buffer(data, size), handler); + asio::async_write(s, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -10803,12 +10975,12 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + auto async_write( AsyncWriteStream & s, const ConstBufferSequence & buffers, CompletionCondition completion_condition, WriteToken && token, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -10834,25 +11006,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -10863,7 +11035,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -10873,10 +11045,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_write(s, - asio::buffer(data, size), - asio::transfer_at_least(32), - handler); + asio::async_write(s, + asio::buffer(data, size), + asio::transfer_at_least(32), + handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -10908,13 +11080,13 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write( AsyncWriteStream & s, DynamicBuffer_v1 && buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >(), + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -10940,13 +11112,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -10957,7 +11129,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -10991,13 +11163,13 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + auto async_write( AsyncWriteStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, WriteToken && token, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11023,25 +11195,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11052,7 +11224,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11084,11 +11256,11 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename Allocator, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write( AsyncWriteStream & s, basic_streambuf< Allocator > & b, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >()); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11114,13 +11286,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11131,7 +11303,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11165,7 +11337,7 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + auto async_write( AsyncWriteStream & s, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, @@ -11195,25 +11367,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11224,7 +11396,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11256,12 +11428,12 @@ Start an asynchronous operation to write all of the supplied data to a stream. template< typename ``[link asio.reference.AsyncWriteStream AsyncWriteStream]``, typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write( AsyncWriteStream & s, DynamicBuffer_v2 buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + WriteToken && token = default_completion_token_t< typename AsyncWriteStream::executor_type >(), + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11287,13 +11459,13 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11304,7 +11476,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11338,12 +11510,12 @@ Start an asynchronous operation to write a certain amount of data to a stream. typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, typename ``[link asio.reference.WriteToken WriteToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write( + auto async_write( AsyncWriteStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, WriteToken && token, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); This function is used to asynchronously write a certain number of bytes of data to a stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11369,25 +11541,25 @@ This operation is implemented in terms of zero or more calls to the stream's asy [[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, + // Result of latest async_write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11398,7 +11570,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11434,12 +11606,12 @@ Start an asynchronous operation to write all of the supplied data at the specifi template< typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write_at.overload1 async_write_at]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto ``[link asio.reference.async_write_at.overload1 async_write_at]``( AsyncRandomAccessWriteDevice & d, uint64_t offset, const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); `` [''''»''' [link asio.reference.async_write_at.overload1 more...]]`` Start an asynchronous operation to write a certain amount of data at the specified offset. @@ -11448,13 +11620,13 @@ Start an asynchronous operation to write a certain amount of data at the specifi typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write_at.overload2 async_write_at]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto ``[link asio.reference.async_write_at.overload2 async_write_at]``( AsyncRandomAccessWriteDevice & d, uint64_t offset, const ConstBufferSequence & buffers, CompletionCondition completion_condition, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); `` [''''»''' [link asio.reference.async_write_at.overload2 more...]]`` Start an asynchronous operation to write all of the supplied data at the specified offset. @@ -11462,12 +11634,12 @@ Start an asynchronous operation to write all of the supplied data at the specifi template< typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename Allocator, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write_at.overload3 async_write_at]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto ``[link asio.reference.async_write_at.overload3 async_write_at]``( AsyncRandomAccessWriteDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); `` [''''»''' [link asio.reference.async_write_at.overload3 more...]]`` Start an asynchronous operation to write a certain amount of data at the specified offset. @@ -11476,18 +11648,18 @@ Start an asynchronous operation to write a certain amount of data at the specifi typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.async_write_at.overload4 async_write_at]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto ``[link asio.reference.async_write_at.overload4 async_write_at]``( AsyncRandomAccessWriteDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); `` [''''»''' [link asio.reference.async_write_at.overload4 more...]]`` [heading Requirements] -['Header: ][^asio/write_at.hpp] +['Header: ][^asio/impl/write_at.hpp] ['Convenience header: ][^asio.hpp] @@ -11501,12 +11673,12 @@ Start an asynchronous operation to write all of the supplied data at the specifi template< typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_at( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto async_write_at( AsyncRandomAccessWriteDevice & d, uint64_t offset, const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11534,13 +11706,13 @@ This operation is implemented in terms of zero or more calls to the device's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11551,7 +11723,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11561,7 +11733,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_write_at(d, 42, asio::buffer(data, size), handler); + asio::async_write_at(d, 42, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -11594,13 +11766,13 @@ Start an asynchronous operation to write a certain amount of data at the specifi typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_at( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto async_write_at( AsyncRandomAccessWriteDevice & d, uint64_t offset, const ConstBufferSequence & buffers, CompletionCondition completion_condition, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11628,25 +11800,25 @@ This operation is implemented in terms of zero or more calls to the device's asy [[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, + // Result of latest async_write_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11657,7 +11829,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11667,10 +11839,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::async_write_at(d, 42, - asio::buffer(data, size), - asio::transfer_at_least(32), - handler); + asio::async_write_at(d, 42, + asio::buffer(data, size), + asio::transfer_at_least(32), + handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -11702,12 +11874,12 @@ Start an asynchronous operation to write all of the supplied data at the specifi template< typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename Allocator, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_at( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto async_write_at( AsyncRandomAccessWriteDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11735,13 +11907,13 @@ This operation is implemented in terms of zero or more calls to the device's asy [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11752,7 +11924,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -11785,13 +11957,13 @@ Start an asynchronous operation to write a certain amount of data at the specifi typename ``[link asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``, typename Allocator, typename ``[link asio.reference.CompletionCondition CompletionCondition]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_at( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type>> + auto async_write_at( AsyncRandomAccessWriteDevice & d, uint64_t offset, basic_streambuf< Allocator > & b, CompletionCondition completion_condition, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< typename AsyncRandomAccessWriteDevice::executor_type >()); This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -11819,25 +11991,25 @@ This operation is implemented in terms of zero or more calls to the device's asy [[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, + // Result of latest async_write_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // 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 - ); + // 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 completion 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 [link asio.reference.post `post`].]] @@ -11848,7 +12020,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -12085,7 +12257,7 @@ Exception thrown when trying to access an empty polymorphic executor. class bad_executor : - public std::exception + public exception [heading Member Functions] @@ -12637,10 +12809,10 @@ Start an asynchronous connect. template< - typename ``[link asio.reference.ConnectToken ConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.ConnectToken ConnectToken]`` = default_completion_token_t> + auto async_connect( const endpoint_type & peer_endpoint, - ConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ConnectToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously connect a socket to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -12658,8 +12830,8 @@ The socket is automatically opened if it is not already open. If the connect fai [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -12670,7 +12842,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -12680,20 +12852,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void connect_handler(const asio::error_code& error) - { - if (!error) - { - // Connect succeeded. - } - } + 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); + 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); @@ -12726,19 +12898,19 @@ Start an asynchronous receive on a connected socket. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_receive.overload1 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_receive.overload1 async_receive]``( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_receive.overload1 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_receive.overload2 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_receive.overload2 async_receive]``( const MutableBufferSequence & buffers, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_receive.overload2 more...]]`` @@ -12750,10 +12922,10 @@ Start an asynchronous receive on a connected socket. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the datagram socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -12769,9 +12941,9 @@ This function is used to asynchronously receive data from the datagram socket. I [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -12782,7 +12954,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -12797,7 +12969,7 @@ The async\_receive operation can only be used with a connected socket. Use the a To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive(asio::buffer(data, size), handler); + socket.async_receive(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -12831,11 +13003,11 @@ Start an asynchronous receive on a connected socket. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the datagram socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -12853,9 +13025,9 @@ This function is used to asynchronously receive data from the datagram socket. I [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -12866,7 +13038,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -12906,21 +13078,21 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_receive_from.overload1 async_receive_from]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_receive_from.overload1 async_receive_from]``( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_receive_from.overload1 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_receive_from.overload2 async_receive_from]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_receive_from.overload2 async_receive_from]``( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_receive_from.overload2 more...]]`` @@ -12932,11 +13104,11 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive_from( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive_from( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive a datagram. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -12954,9 +13126,9 @@ This function is used to asynchronously receive a datagram. It is an initiating [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -12967,7 +13139,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -12977,8 +13149,8 @@ Regardless of whether the asynchronous operation completes immediately or not, t To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive_from( - asio::buffer(data, size), sender_endpoint, handler); + socket.async_receive_from( + asio::buffer(data, size), sender_endpoint, handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -13012,12 +13184,12 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive_from( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive_from( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive a datagram. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -13037,9 +13209,9 @@ This function is used to asynchronously receive a datagram. It is an initiating [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -13050,7 +13222,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -13085,19 +13257,19 @@ Start an asynchronous send on a connected socket. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_send.overload1 async_send]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_send.overload1 async_send]``( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_send.overload1 more...]]`` template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_send.overload2 async_send]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_send.overload2 async_send]``( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_send.overload2 more...]]`` @@ -13109,10 +13281,10 @@ Start an asynchronous send on a connected socket. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the datagram socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -13128,9 +13300,9 @@ This function is used to asynchronously send data on the datagram socket. It is [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -13141,7 +13313,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -13156,7 +13328,7 @@ The async\_send operation can only be used with a connected socket. Use the asyn To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_send(asio::buffer(data, size), handler); + socket.async_send(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -13190,11 +13362,11 @@ Start an asynchronous send on a connected socket. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the datagram socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -13212,9 +13384,9 @@ This function is used to asynchronously send data on the datagram socket. It is [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -13225,7 +13397,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -13265,21 +13437,21 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_send_to.overload1 async_send_to]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_send_to.overload1 async_send_to]``( const ConstBufferSequence & buffers, const endpoint_type & destination, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_send_to.overload1 more...]]`` template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_datagram_socket.async_send_to.overload2 async_send_to]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_datagram_socket.async_send_to.overload2 async_send_to]``( const ConstBufferSequence & buffers, const endpoint_type & destination, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_datagram_socket.async_send_to.overload2 more...]]`` @@ -13291,11 +13463,11 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send_to( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send_to( const ConstBufferSequence & buffers, const endpoint_type & destination, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send a datagram to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -13313,9 +13485,9 @@ This function is used to asynchronously send a datagram to the specified remote [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -13326,7 +13498,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -13336,10 +13508,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t To send a single data buffer use the [link asio.reference.buffer `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); + 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 [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -13373,12 +13545,12 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send_to( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send_to( const ConstBufferSequence & buffers, const endpoint_type & destination, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send a datagram to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -13398,9 +13570,9 @@ This function is used to asynchronously send a datagram to the specified remote [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -13411,7 +13583,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -13449,10 +13621,10 @@ Asynchronously wait for the socket to become ready to read, ready to write, or t template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -13468,8 +13640,8 @@ This function is used to perform an asynchronous wait for a socket to enter a re [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -13480,7 +13652,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -13490,19 +13662,19 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::ip::tcp::socket socket(my_context); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -13717,7 +13889,7 @@ Construct a [link asio.reference.basic_datagram_socket `basic_datagram_socket`] typename ExecutionContext> explicit ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload2 basic_datagram_socket]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload2 more...]]`` @@ -13734,7 +13906,7 @@ Construct and open a [link asio.reference.basic_datagram_socket `basic_datagram_ ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload4 basic_datagram_socket]``( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload4 more...]]`` @@ -13751,7 +13923,7 @@ Construct a [link asio.reference.basic_datagram_socket `basic_datagram_socket`], ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload6 basic_datagram_socket]``( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload6 more...]]`` @@ -13770,7 +13942,7 @@ Construct a [link asio.reference.basic_datagram_socket `basic_datagram_socket`] ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload8 more...]]`` @@ -13790,7 +13962,7 @@ Move-construct a [link asio.reference.basic_datagram_socket `basic_datagram_sock typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload10 basic_datagram_socket]``( basic_datagram_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload10 more...]]`` @@ -13833,7 +14005,7 @@ Construct a [link asio.reference.basic_datagram_socket `basic_datagram_socket`] typename ExecutionContext> basic_datagram_socket( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -13908,7 +14080,7 @@ Construct and open a [link asio.reference.basic_datagram_socket `basic_datagram_ basic_datagram_socket( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates and opens a datagram socket. @@ -13995,7 +14167,7 @@ Construct a [link asio.reference.basic_datagram_socket `basic_datagram_socket`], basic_datagram_socket( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -14086,7 +14258,7 @@ Construct a [link asio.reference.basic_datagram_socket `basic_datagram_socket`] ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a datagram socket object to hold an existing native socket. @@ -14167,7 +14339,7 @@ Move-construct a [link asio.reference.basic_datagram_socket `basic_datagram_sock typename ``[link asio.reference.Executor1 Executor1]``> basic_datagram_socket( basic_datagram_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); This constructor moves a datagram socket from one object to another. @@ -14251,10 +14423,10 @@ This function binds the socket to the specified endpoint on the local machine. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); - socket.bind(asio::ip::tcp::endpoint( - asio::ip::tcp::v4(), 12345)); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); + socket.bind(asio::ip::tcp::endpoint( + asio::ip::tcp::v4(), 12345)); @@ -14299,15 +14471,15 @@ This function binds the socket to the specified endpoint on the local machine. - 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. - } + 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. + } @@ -14341,10 +14513,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -14352,11 +14524,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -14395,11 +14567,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -14613,14 +14785,14 @@ This function is used to close the socket. Any asynchronous send, receive or con - asio::ip::tcp::socket socket(my_context); - ... - asio::error_code ec; - socket.close(ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.close(ec); + if (ec) + { + // An error occurred. + } @@ -14696,10 +14868,10 @@ The socket is automatically opened if it is not already open. If the connect fai - 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); + 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); @@ -14746,15 +14918,15 @@ The socket is automatically opened if it is not already open. If the connect fai - 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. - } + 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. + } @@ -14788,10 +14960,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -14799,11 +14971,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -14842,10 +15014,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -14853,11 +15025,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -14896,10 +15068,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -14907,11 +15079,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -15051,11 +15223,11 @@ This function is used to get the current value of an option on the socket. 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::socket::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -15103,16 +15275,16 @@ This function is used to get the current value of an option on the socket. 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(); + 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(); @@ -15188,11 +15360,11 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -15240,16 +15412,16 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -15300,10 +15472,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -15311,11 +15483,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -15354,10 +15526,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -15365,12 +15537,12 @@ Setting the 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(); + 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(); @@ -15436,9 +15608,9 @@ An object that represents the local endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -15485,14 +15657,14 @@ An object that represents the local endpoint of the socket. Returns a default-co - 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. - } + 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. + } @@ -16190,69 +16362,69 @@ The current non-blocking mode is cached by the socket object. Consequently, the 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -16305,69 +16477,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -16413,69 +16585,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -16680,8 +16852,8 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); @@ -16726,13 +16898,13 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - asio::error_code ec; - socket.open(asio::ip::tcp::v4(), ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + asio::error_code ec; + socket.open(asio::ip::tcp::v4(), ec); + if (ec) + { + // An error occurred. + } @@ -16762,7 +16934,7 @@ Move-assign a [link asio.reference.basic_datagram_socket `basic_datagram_socket` template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_datagram_socket & >::type ``[link asio.reference.basic_datagram_socket.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_datagram_socket & > ``[link asio.reference.basic_datagram_socket.operator_eq_.overload2 operator=]``( basic_datagram_socket< Protocol1, Executor1 > && other); `` [''''»''' [link asio.reference.basic_datagram_socket.operator_eq_.overload2 more...]]`` @@ -16810,7 +16982,7 @@ Move-assign a [link asio.reference.basic_datagram_socket `basic_datagram_socket` template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_datagram_socket & >::type operator=( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_datagram_socket & > operator=( basic_datagram_socket< Protocol1, Executor1 > && other); @@ -16860,10 +17032,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -16871,11 +17043,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -16991,7 +17163,7 @@ The receive operation can only be used with a connected socket. Use the receive\ To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.receive(asio::buffer(data, size)); + socket.receive(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -17126,10 +17298,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -17137,11 +17309,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -17237,9 +17409,9 @@ The number of bytes received. To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::ip::udp::endpoint sender_endpoint; - socket.receive_from( - asio::buffer(data, size), sender_endpoint); + asio::ip::udp::endpoint sender_endpoint; + socket.receive_from( + asio::buffer(data, size), sender_endpoint); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -17370,10 +17542,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -17381,11 +17553,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -17539,9 +17711,9 @@ An object that represents the remote endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -17588,14 +17760,14 @@ An object that represents the remote endpoint of the socket. Returns a default-c - 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. - } + 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. + } @@ -17629,10 +17801,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -17640,11 +17812,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -17739,7 +17911,7 @@ The send operation can only be used with a connected socket. Use the send\_to fu To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.send(asio::buffer(data, size)); + socket.send(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -17874,10 +18046,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -17885,11 +18057,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -17928,10 +18100,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -17939,11 +18111,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -18039,9 +18211,9 @@ The number of bytes sent. To send a single data buffer use the [link asio.reference.buffer `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); + 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 [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -18214,10 +18386,10 @@ This function is used to set an option on the socket. 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option(true); + socket.set_option(option); @@ -18265,15 +18437,15 @@ This function is used to set an option on the socket. 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. - } + 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. + } @@ -18342,9 +18514,9 @@ This function is used to disable send operations, receive operations, or both. Shutting down the send side of the socket: - asio::ip::tcp::socket socket(my_context); - ... - socket.shutdown(asio::ip::tcp::socket::shutdown_send); + asio::ip::tcp::socket socket(my_context); + ... + socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -18389,14 +18561,14 @@ This function is used to disable send operations, receive operations, or both. 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. - } + 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. + } @@ -18495,9 +18667,9 @@ This function is used to perform a blocking wait for a socket to enter a ready t Waiting for a socket to become readable. - asio::ip::tcp::socket socket(my_context); - ... - socket.wait(asio::ip::tcp::socket::wait_read); + asio::ip::tcp::socket socket(my_context); + ... + socket.wait(asio::ip::tcp::socket::wait_read); @@ -18542,10 +18714,10 @@ This function is used to perform a blocking wait for a socket to enter a ready t 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -19221,14 +19393,14 @@ Most applications will use the [link asio.reference.deadline_timer `deadline_tim Performing a blocking wait: - // Construct a timer without setting an expiry time. - asio::deadline_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_from_now(boost::posix_time::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -19236,22 +19408,22 @@ Performing a blocking wait: Performing an asynchronous wait: - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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")); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -19265,26 +19437,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -19311,9 +19483,9 @@ Start an asynchronous wait on the timer. template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( + WaitToken && token = default_completion_token_t< executor_type >()); This function may be used to initiate an asynchronous wait against the timer. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -19335,8 +19507,8 @@ For each call to `async_wait()`, the completion handler will be called exactly o [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the timer expires. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -19347,7 +19519,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -19386,7 +19558,7 @@ Constructor. typename ExecutionContext> explicit ``[link asio.reference.basic_deadline_timer.basic_deadline_timer.overload2 basic_deadline_timer]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_deadline_timer.basic_deadline_timer.overload2 more...]]`` @@ -19403,7 +19575,7 @@ Constructor to set a particular expiry time as an absolute time. ``[link asio.reference.basic_deadline_timer.basic_deadline_timer.overload4 basic_deadline_timer]``( ExecutionContext & context, const time_type & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_deadline_timer.basic_deadline_timer.overload4 more...]]`` @@ -19420,7 +19592,7 @@ Constructor to set a particular expiry time relative to now. ``[link asio.reference.basic_deadline_timer.basic_deadline_timer.overload6 basic_deadline_timer]``( ExecutionContext & context, const duration_type & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_deadline_timer.basic_deadline_timer.overload6 more...]]`` @@ -19471,7 +19643,7 @@ Constructor. typename ExecutionContext> basic_deadline_timer( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -19536,7 +19708,7 @@ Constructor to set a particular expiry time as an absolute time. basic_deadline_timer( ExecutionContext & context, const time_type & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a timer and sets the expiry time. @@ -19603,7 +19775,7 @@ Constructor to set a particular expiry time relative to now. basic_deadline_timer( ExecutionContext & context, const duration_type & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a timer and sets the expiry time. @@ -20554,14 +20726,14 @@ Most applications will use the [link asio.reference.deadline_timer `deadline_tim Performing a blocking wait: - // Construct a timer without setting an expiry time. - asio::deadline_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_from_now(boost::posix_time::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -20569,22 +20741,22 @@ Performing a blocking wait: Performing an asynchronous wait: - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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")); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -20598,26 +20770,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -20940,7 +21112,7 @@ Construct a [link asio.reference.basic_file `basic_file`] without opening it. typename ExecutionContext> explicit ``[link asio.reference.basic_file.basic_file.overload2 basic_file]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_file.basic_file.overload2 more...]]`` @@ -20959,7 +21131,7 @@ Construct and open a [link asio.reference.basic_file `basic_file`]. ExecutionContext & context, const char * path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_file.basic_file.overload4 more...]]`` explicit ``[link asio.reference.basic_file.basic_file.overload5 basic_file]``( @@ -20974,7 +21146,7 @@ Construct and open a [link asio.reference.basic_file `basic_file`]. ExecutionContext & context, const std::string & path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_file.basic_file.overload6 more...]]`` @@ -20995,7 +21167,7 @@ Construct a [link asio.reference.basic_file `basic_file`] on an existing native ``[link asio.reference.basic_file.basic_file.overload8 basic_file]``( ExecutionContext & context, const native_handle_type & native_file, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_file.basic_file.overload8 more...]]`` @@ -21014,7 +21186,7 @@ Move-construct a [link asio.reference.basic_file `basic_file`] from a file of an typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_file.basic_file.overload10 basic_file]``( basic_file< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_file.basic_file.overload10 more...]]`` @@ -21057,7 +21229,7 @@ Construct a [link asio.reference.basic_file `basic_file`] without opening it. typename ExecutionContext> basic_file( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a file without opening it. @@ -21126,7 +21298,7 @@ Construct a [link asio.reference.basic_file `basic_file`] without opening it. ExecutionContext & context, const char * path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a file and opens it. @@ -21199,7 +21371,7 @@ Construct a [link asio.reference.basic_file `basic_file`] without opening it. ExecutionContext & context, const std::string & path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a file and opens it. @@ -21278,7 +21450,7 @@ Construct a [link asio.reference.basic_file `basic_file`] on an existing native basic_file( ExecutionContext & context, const native_handle_type & native_file, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a file object to hold an existing native file. @@ -21337,7 +21509,7 @@ This constructor moves a file from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&)` constructor. @@ -21356,7 +21528,7 @@ Move-construct a [link asio.reference.basic_file `basic_file`] from a file of an typename ``[link asio.reference.Executor1 Executor1]``> basic_file( basic_file< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a file from one object to another. @@ -21374,7 +21546,7 @@ This constructor moves a file from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&)` constructor. @@ -21551,14 +21723,14 @@ This function is used to close the file. Any asynchronous read or write operatio - asio::stream_file file(my_context); - ... - asio::error_code ec; - file.close(ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + ... + asio::error_code ec; + file.close(ec); + if (ec) + { + // An error occurred. + } @@ -21784,8 +21956,8 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - file.open("/path/to/my/file", asio::stream_file::read_only); + asio::stream_file file(my_context); + file.open("/path/to/my/file", asio::stream_file::read_only); @@ -21830,13 +22002,13 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - asio::error_code ec; - file.open("/path/to/my/file", asio::stream_file::read_only, ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + asio::error_code ec; + file.open("/path/to/my/file", asio::stream_file::read_only, ec); + if (ec) + { + // An error occurred. + } @@ -21888,8 +22060,8 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - file.open("/path/to/my/file", asio::stream_file::read_only); + asio::stream_file file(my_context); + file.open("/path/to/my/file", asio::stream_file::read_only); @@ -21934,13 +22106,13 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - asio::error_code ec; - file.open("/path/to/my/file", asio::stream_file::read_only, ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + asio::error_code ec; + file.open("/path/to/my/file", asio::stream_file::read_only, ec); + if (ec) + { + // An error occurred. + } @@ -21969,7 +22141,7 @@ Move-assign a [link asio.reference.basic_file `basic_file`] from a file of anoth template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_file & >::type ``[link asio.reference.basic_file.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_file & > ``[link asio.reference.basic_file.operator_eq_.overload2 operator=]``( basic_file< Executor1 > && other); `` [''''»''' [link asio.reference.basic_file.operator_eq_.overload2 more...]]`` @@ -21999,7 +22171,7 @@ This assignment operator moves a file from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&)` constructor. @@ -22016,7 +22188,7 @@ Move-assign a [link asio.reference.basic_file `basic_file`] from a file of anoth template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_file & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_file & > operator=( basic_file< Executor1 > && other); @@ -22035,7 +22207,7 @@ This assignment operator moves a file from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_file(const executor_type&)` constructor. @@ -22979,7 +23151,7 @@ Construct a [link asio.reference.basic_io_object `basic_io_object`]. Performs: - get_service().construct(get_implementation()); + get_service().construct(get_implementation()); @@ -23001,8 +23173,8 @@ Move-construct a [link asio.reference.basic_io_object `basic_io_object`]. Performs: - get_service().move_construct( - get_implementation(), other.get_implementation()); + get_service().move_construct( + get_implementation(), other.get_implementation()); @@ -23237,8 +23409,8 @@ Move-assign a [link asio.reference.basic_io_object `basic_io_object`]. Performs: - get_service().move_assign(get_implementation(), - other.get_service(), other.get_implementation()); + get_service().move_assign(get_implementation(), + other.get_service(), other.get_implementation()); @@ -23287,9 +23459,361 @@ Protected destructor to prevent deletion through this type. Performs: - get_service().destroy(get_implementation()); + get_service().destroy(get_implementation()); + + + + + +[endsect] + + + +[endsect] + +[section:basic_io_object_lt__IoObjectService_comma__true__gt_ basic_io_object< IoObjectService, true >] + +[indexterm1 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_..basic_io_object< IoObjectService, true >] + + + + template< + typename ``[link asio.reference.IoObjectService IoObjectService]``> + class basic_io_object< IoObjectService, true > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.executor_type [*executor_type]]] + [] + + ] + + [ + + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.implementation_type [*implementation_type]]] + [] + + ] + + [ + + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.service_type [*service_type]]] + [] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_executor [*get_executor]]] + [] + ] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_io_context [*get_io_context]]] + [] + ] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_io_service [*get_io_service]]] + [] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object [*basic_io_object]]] + [] + ] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_implementation [*get_implementation]]] + [] + ] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_service [*get_service]]] + [] + ] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.operator_eq_ [*operator=]]] + [] + ] + + [ + [[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_._basic_io_object [*~basic_io_object]] [destructor]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/basic_io_object.hpp] + +['Convenience header: ][^asio.hpp] + +[section:basic_io_object basic_io_object< IoObjectService, true >::basic_io_object] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object..basic_io_object..basic_io_object< IoObjectService, true >] + + explicit ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object.overload1 basic_io_object]``( + asio::io_context & io_context); + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object.overload1 more...]]`` + + ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object.overload2 basic_io_object]``( + basic_io_object && other); + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object.overload2 more...]]`` + + template< + typename ``[link asio.reference.IoObjectService IoObjectService1]``> + ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object.overload3 basic_io_object]``( + IoObjectService1 & other_service, + typename IoObjectService1::implementation_type & other_implementation); + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.basic_io_object.overload3 more...]]`` + + +[section:overload1 basic_io_object< IoObjectService, true >::basic_io_object (1 of 3 overloads)] + + + + basic_io_object( + asio::io_context & io_context); + + + +[endsect] + + + +[section:overload2 basic_io_object< IoObjectService, true >::basic_io_object (2 of 3 overloads)] + + + + basic_io_object( + basic_io_object && other); + + + +[endsect] + + + +[section:overload3 basic_io_object< IoObjectService, true >::basic_io_object (3 of 3 overloads)] + + + + template< + typename ``[link asio.reference.IoObjectService IoObjectService1]``> + basic_io_object( + IoObjectService1 & other_service, + typename IoObjectService1::implementation_type & other_implementation); + + + +[endsect] + + +[endsect] + + +[section:executor_type basic_io_object< IoObjectService, true >::executor_type] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.executor_type..executor_type..basic_io_object< IoObjectService, true >] + + typedef asio::io_context::executor_type executor_type; + + + +[heading Requirements] + +['Header: ][^asio/basic_io_object.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_io_object< IoObjectService, true >::get_executor] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.get_executor..get_executor..basic_io_object< IoObjectService, true >] + + executor_type get_executor(); + + + +[endsect] + + +[section:get_implementation basic_io_object< IoObjectService, true >::get_implementation] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.get_implementation..get_implementation..basic_io_object< IoObjectService, true >] + + implementation_type & ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_implementation.overload1 get_implementation]``(); + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_implementation.overload1 more...]]`` + + const implementation_type & ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_implementation.overload2 get_implementation]``() const; + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_implementation.overload2 more...]]`` + + +[section:overload1 basic_io_object< IoObjectService, true >::get_implementation (1 of 2 overloads)] + + + + implementation_type & get_implementation(); + + + +[endsect] + + + +[section:overload2 basic_io_object< IoObjectService, true >::get_implementation (2 of 2 overloads)] + + + + const implementation_type & get_implementation() const; + + + +[endsect] +[endsect] + + +[section:get_io_context basic_io_object< IoObjectService, true >::get_io_context] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.get_io_context..get_io_context..basic_io_object< IoObjectService, true >] + + asio::io_context & get_io_context(); + + + +[endsect] + + + +[section:get_io_service basic_io_object< IoObjectService, true >::get_io_service] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.get_io_service..get_io_service..basic_io_object< IoObjectService, true >] + + asio::io_context & get_io_service(); + + + +[endsect] + + +[section:get_service basic_io_object< IoObjectService, true >::get_service] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.get_service..get_service..basic_io_object< IoObjectService, true >] + + service_type & ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_service.overload1 get_service]``(); + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_service.overload1 more...]]`` + + const service_type & ``[link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_service.overload2 get_service]``() const; + `` [''''»''' [link asio.reference.basic_io_object_lt__IoObjectService_comma__true__gt_.get_service.overload2 more...]]`` + + +[section:overload1 basic_io_object< IoObjectService, true >::get_service (1 of 2 overloads)] + + + + service_type & get_service(); + + + +[endsect] + + + +[section:overload2 basic_io_object< IoObjectService, true >::get_service (2 of 2 overloads)] + + + + const service_type & get_service() const; + + + +[endsect] + + +[endsect] + + +[section:implementation_type basic_io_object< IoObjectService, true >::implementation_type] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.implementation_type..implementation_type..basic_io_object< IoObjectService, true >] + + typedef service_type::implementation_type implementation_type; + + + +[heading Requirements] + +['Header: ][^asio/basic_io_object.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq_ basic_io_object< IoObjectService, true >::operator=] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.operator_eq_..operator=..basic_io_object< IoObjectService, true >] + + basic_io_object & operator=( + basic_io_object && other); + + + +[endsect] + + + +[section:service_type basic_io_object< IoObjectService, true >::service_type] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_.service_type..service_type..basic_io_object< IoObjectService, true >] + + typedef IoObjectService service_type; + + + +[heading Requirements] + +['Header: ][^asio/basic_io_object.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:_basic_io_object basic_io_object< IoObjectService, true >::~basic_io_object] + +[indexterm2 asio.indexterm.basic_io_object_lt__IoObjectService_comma__true__gt_._basic_io_object..~basic_io_object..basic_io_object< IoObjectService, true >] + + ~basic_io_object(); @@ -23608,11 +24132,11 @@ Start an asynchronous read at the specified offset. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some_at( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some_at( uint64_t offset, const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the random-access handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -23630,9 +24154,9 @@ This function is used to asynchronously read data from the random-access handle. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -23643,7 +24167,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -23658,7 +24182,7 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.async_read_some_at(42, asio::buffer(data, size), handler); + handle.async_read_some_at(42, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -23692,11 +24216,11 @@ Start an asynchronous write at the specified offset. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some_at( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some_at( uint64_t offset, const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the random-access handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -23714,9 +24238,9 @@ This function is used to asynchronously write data to the random-access handle. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -23727,7 +24251,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -23742,7 +24266,7 @@ The write operation may not write all of the data to the file. Consider using th To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.async_write_some_at(42, asio::buffer(data, size), handler); + handle.async_write_some_at(42, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -23781,7 +24305,7 @@ Construct a [link asio.reference.basic_random_access_file `basic_random_access_f typename ExecutionContext> explicit ``[link asio.reference.basic_random_access_file.basic_random_access_file.overload2 basic_random_access_file]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_random_access_file.basic_random_access_file.overload2 more...]]`` @@ -23800,7 +24324,7 @@ Construct and open a [link asio.reference.basic_random_access_file `basic_random ExecutionContext & context, const char * path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_random_access_file.basic_random_access_file.overload4 more...]]`` ``[link asio.reference.basic_random_access_file.basic_random_access_file.overload5 basic_random_access_file]``( @@ -23815,7 +24339,7 @@ Construct and open a [link asio.reference.basic_random_access_file `basic_random ExecutionContext & context, const std::string & path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_random_access_file.basic_random_access_file.overload6 more...]]`` @@ -23832,7 +24356,7 @@ Construct a [link asio.reference.basic_random_access_file `basic_random_access_f ``[link asio.reference.basic_random_access_file.basic_random_access_file.overload8 basic_random_access_file]``( ExecutionContext & context, const native_handle_type & native_file, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_random_access_file.basic_random_access_file.overload8 more...]]`` @@ -23851,7 +24375,7 @@ Move-construct a [link asio.reference.basic_random_access_file `basic_random_acc typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_random_access_file.basic_random_access_file.overload10 basic_random_access_file]``( basic_random_access_file< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_random_access_file.basic_random_access_file.overload10 more...]]`` @@ -23894,7 +24418,7 @@ Construct a [link asio.reference.basic_random_access_file `basic_random_access_f typename ExecutionContext> basic_random_access_file( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a file without opening it. The file needs to be opened before data can be read from or or written to it. @@ -23973,7 +24497,7 @@ Construct and open a [link asio.reference.basic_random_access_file `basic_random ExecutionContext & context, const char * path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises and opens a file. @@ -24066,7 +24590,7 @@ Construct and open a [link asio.reference.basic_random_access_file `basic_random ExecutionContext & context, const std::string & path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises and opens a file. @@ -24155,7 +24679,7 @@ Construct a [link asio.reference.basic_random_access_file `basic_random_access_f basic_random_access_file( ExecutionContext & context, const native_handle_type & native_file, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a random-access file object to hold an existing native file. @@ -24233,7 +24757,7 @@ Move-construct a [link asio.reference.basic_random_access_file `basic_random_acc typename ``[link asio.reference.Executor1 Executor1]``> basic_random_access_file( basic_random_access_file< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a random-access file from one object to another. @@ -24440,14 +24964,14 @@ This function is used to close the file. Any asynchronous read or write operatio - asio::stream_file file(my_context); - ... - asio::error_code ec; - file.close(ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + ... + asio::error_code ec; + file.close(ec); + if (ec) + { + // An error occurred. + } @@ -24685,8 +25209,8 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - file.open("/path/to/my/file", asio::stream_file::read_only); + asio::stream_file file(my_context); + file.open("/path/to/my/file", asio::stream_file::read_only); @@ -24734,13 +25258,13 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - asio::error_code ec; - file.open("/path/to/my/file", asio::stream_file::read_only, ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + asio::error_code ec; + file.open("/path/to/my/file", asio::stream_file::read_only, ec); + if (ec) + { + // An error occurred. + } @@ -24795,8 +25319,8 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - file.open("/path/to/my/file", asio::stream_file::read_only); + asio::stream_file file(my_context); + file.open("/path/to/my/file", asio::stream_file::read_only); @@ -24844,13 +25368,13 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - asio::error_code ec; - file.open("/path/to/my/file", asio::stream_file::read_only, ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + asio::error_code ec; + file.open("/path/to/my/file", asio::stream_file::read_only, ec); + if (ec) + { + // An error occurred. + } @@ -24879,7 +25403,7 @@ Move-assign a [link asio.reference.basic_random_access_file `basic_random_access template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_random_access_file & >::type ``[link asio.reference.basic_random_access_file.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_random_access_file & > ``[link asio.reference.basic_random_access_file.operator_eq_.overload2 operator=]``( basic_random_access_file< Executor1 > && other); `` [''''»''' [link asio.reference.basic_random_access_file.operator_eq_.overload2 more...]]`` @@ -24926,7 +25450,7 @@ Move-assign a [link asio.reference.basic_random_access_file `basic_random_access template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_random_access_file & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_random_access_file & > operator=( basic_random_access_file< Executor1 > && other); @@ -25046,7 +25570,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.read_some_at(42, asio::buffer(data, size)); + handle.read_some_at(42, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -25704,7 +26228,7 @@ The write\_some\_at operation may not write all of the data. Consider using the To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.write_some_at(42, asio::buffer(data, size)); + handle.write_some_at(42, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -26544,10 +27068,10 @@ Start an asynchronous connect. template< - typename ``[link asio.reference.ConnectToken ConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.ConnectToken ConnectToken]`` = default_completion_token_t> + auto async_connect( const endpoint_type & peer_endpoint, - ConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ConnectToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously connect a socket to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -26565,8 +27089,8 @@ The socket is automatically opened if it is not already open. If the connect fai [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -26577,7 +27101,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -26587,20 +27111,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void connect_handler(const asio::error_code& error) - { - if (!error) - { - // Connect succeeded. - } - } + 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); + 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); @@ -26633,19 +27157,19 @@ Start an asynchronous receive on a connected socket. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_receive.overload1 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_receive.overload1 async_receive]``( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_receive.overload1 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_receive.overload2 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_receive.overload2 async_receive]``( const MutableBufferSequence & buffers, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_receive.overload2 more...]]`` @@ -26657,10 +27181,10 @@ Start an asynchronous receive on a connected socket. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the raw socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -26676,9 +27200,9 @@ This function is used to asynchronously receive data from the raw socket. It is [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -26689,7 +27213,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -26704,7 +27228,7 @@ The async\_receive operation can only be used with a connected socket. Use the a To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive(asio::buffer(data, size), handler); + socket.async_receive(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -26738,11 +27262,11 @@ Start an asynchronous receive on a connected socket. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the raw socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -26760,9 +27284,9 @@ This function is used to asynchronously receive data from the raw socket. It is [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -26773,7 +27297,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -26813,21 +27337,21 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_receive_from.overload1 async_receive_from]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_receive_from.overload1 async_receive_from]``( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_receive_from.overload1 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_receive_from.overload2 async_receive_from]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_receive_from.overload2 async_receive_from]``( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_receive_from.overload2 more...]]`` @@ -26839,11 +27363,11 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive_from( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive_from( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive raw data. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -26861,9 +27385,9 @@ This function is used to asynchronously receive raw data. It is an initiating fu [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -26874,7 +27398,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -26884,8 +27408,8 @@ Regardless of whether the asynchronous operation completes immediately or not, t To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive_from( - asio::buffer(data, size), 0, sender_endpoint, handler); + socket.async_receive_from( + asio::buffer(data, size), 0, sender_endpoint, handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -26919,12 +27443,12 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive_from( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive_from( const MutableBufferSequence & buffers, endpoint_type & sender_endpoint, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive raw data. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -26944,9 +27468,9 @@ This function is used to asynchronously receive raw data. It is an initiating fu [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -26957,7 +27481,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -26992,19 +27516,19 @@ Start an asynchronous send on a connected socket. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_send.overload1 async_send]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_send.overload1 async_send]``( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_send.overload1 more...]]`` template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_send.overload2 async_send]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_send.overload2 async_send]``( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_send.overload2 more...]]`` @@ -27016,10 +27540,10 @@ Start an asynchronous send on a connected socket. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the raw socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -27035,9 +27559,9 @@ This function is used to asynchronously send data on the raw socket. It is an in [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -27048,7 +27572,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -27063,7 +27587,7 @@ The async\_send operation can only be used with a connected socket. Use the asyn To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_send(asio::buffer(data, size), handler); + socket.async_send(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -27097,11 +27621,11 @@ Start an asynchronous send on a connected socket. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the raw socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -27119,9 +27643,9 @@ This function is used to asynchronously send data on the raw socket. It is an in [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -27132,7 +27656,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -27172,21 +27696,21 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_send_to.overload1 async_send_to]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_send_to.overload1 async_send_to]``( const ConstBufferSequence & buffers, const endpoint_type & destination, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_send_to.overload1 more...]]`` template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_raw_socket.async_send_to.overload2 async_send_to]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_raw_socket.async_send_to.overload2 async_send_to]``( const ConstBufferSequence & buffers, const endpoint_type & destination, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_raw_socket.async_send_to.overload2 more...]]`` @@ -27198,11 +27722,11 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send_to( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send_to( const ConstBufferSequence & buffers, const endpoint_type & destination, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send raw data to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -27220,9 +27744,9 @@ This function is used to asynchronously send raw data to the specified remote en [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -27233,7 +27757,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -27243,10 +27767,10 @@ Regardless of whether the asynchronous operation completes immediately or not, t To send a single data buffer use the [link asio.reference.buffer `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); + 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 [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -27280,12 +27804,12 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send_to( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send_to( const ConstBufferSequence & buffers, const endpoint_type & destination, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send raw data to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -27305,9 +27829,9 @@ This function is used to asynchronously send raw data to the specified remote en [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -27318,7 +27842,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -27356,10 +27880,10 @@ Asynchronously wait for the socket to become ready to read, ready to write, or t template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -27375,8 +27899,8 @@ This function is used to perform an asynchronous wait for a socket to enter a re [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -27387,7 +27911,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -27397,19 +27921,19 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::ip::tcp::socket socket(my_context); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -27624,7 +28148,7 @@ Construct a [link asio.reference.basic_raw_socket `basic_raw_socket`] without op typename ExecutionContext> explicit ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload2 basic_raw_socket]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload2 more...]]`` @@ -27641,7 +28165,7 @@ Construct and open a [link asio.reference.basic_raw_socket `basic_raw_socket`]. ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload4 basic_raw_socket]``( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload4 more...]]`` @@ -27658,7 +28182,7 @@ Construct a [link asio.reference.basic_raw_socket `basic_raw_socket`], opening i ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload6 basic_raw_socket]``( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload6 more...]]`` @@ -27677,7 +28201,7 @@ Construct a [link asio.reference.basic_raw_socket `basic_raw_socket`] on an exis ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload8 more...]]`` @@ -27697,7 +28221,7 @@ Move-construct a [link asio.reference.basic_raw_socket `basic_raw_socket`] from typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload10 basic_raw_socket]``( basic_raw_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload10 more...]]`` @@ -27740,7 +28264,7 @@ Construct a [link asio.reference.basic_raw_socket `basic_raw_socket`] without op typename ExecutionContext> basic_raw_socket( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -27815,7 +28339,7 @@ Construct and open a [link asio.reference.basic_raw_socket `basic_raw_socket`]. basic_raw_socket( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates and opens a raw socket. @@ -27902,7 +28426,7 @@ Construct a [link asio.reference.basic_raw_socket `basic_raw_socket`], opening i basic_raw_socket( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -27993,7 +28517,7 @@ Construct a [link asio.reference.basic_raw_socket `basic_raw_socket`] on an exis ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a raw socket object to hold an existing native socket. @@ -28074,7 +28598,7 @@ Move-construct a [link asio.reference.basic_raw_socket `basic_raw_socket`] from typename ``[link asio.reference.Executor1 Executor1]``> basic_raw_socket( basic_raw_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); This constructor moves a raw socket from one object to another. @@ -28158,10 +28682,10 @@ This function binds the socket to the specified endpoint on the local machine. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); - socket.bind(asio::ip::tcp::endpoint( - asio::ip::tcp::v4(), 12345)); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); + socket.bind(asio::ip::tcp::endpoint( + asio::ip::tcp::v4(), 12345)); @@ -28206,15 +28730,15 @@ This function binds the socket to the specified endpoint on the local machine. - 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. - } + 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. + } @@ -28248,10 +28772,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -28259,11 +28783,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -28302,11 +28826,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -28520,14 +29044,14 @@ This function is used to close the socket. Any asynchronous send, receive or con - asio::ip::tcp::socket socket(my_context); - ... - asio::error_code ec; - socket.close(ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.close(ec); + if (ec) + { + // An error occurred. + } @@ -28603,10 +29127,10 @@ The socket is automatically opened if it is not already open. If the connect fai - 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); + 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); @@ -28653,15 +29177,15 @@ The socket is automatically opened if it is not already open. If the connect fai - 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. - } + 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. + } @@ -28695,10 +29219,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -28706,11 +29230,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -28749,10 +29273,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -28760,11 +29284,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -28803,10 +29327,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -28814,11 +29338,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -28958,11 +29482,11 @@ This function is used to get the current value of an option on the socket. 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::socket::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -29010,16 +29534,16 @@ This function is used to get the current value of an option on the socket. 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(); + 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(); @@ -29095,11 +29619,11 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -29147,16 +29671,16 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -29207,10 +29731,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -29218,11 +29742,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -29261,10 +29785,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -29272,12 +29796,12 @@ Setting the 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(); + 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(); @@ -29343,9 +29867,9 @@ An object that represents the local endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -29392,14 +29916,14 @@ An object that represents the local endpoint of the socket. Returns a default-co - 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. - } + 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. + } @@ -30097,69 +30621,69 @@ The current non-blocking mode is cached by the socket object. Consequently, the 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -30212,69 +30736,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -30320,69 +30844,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -30587,8 +31111,8 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); @@ -30633,13 +31157,13 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - asio::error_code ec; - socket.open(asio::ip::tcp::v4(), ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + asio::error_code ec; + socket.open(asio::ip::tcp::v4(), ec); + if (ec) + { + // An error occurred. + } @@ -30669,7 +31193,7 @@ Move-assign a [link asio.reference.basic_raw_socket `basic_raw_socket`] from a s template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_raw_socket & >::type ``[link asio.reference.basic_raw_socket.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_raw_socket & > ``[link asio.reference.basic_raw_socket.operator_eq_.overload2 operator=]``( basic_raw_socket< Protocol1, Executor1 > && other); `` [''''»''' [link asio.reference.basic_raw_socket.operator_eq_.overload2 more...]]`` @@ -30717,7 +31241,7 @@ Move-assign a [link asio.reference.basic_raw_socket `basic_raw_socket`] from a s template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_raw_socket & >::type operator=( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_raw_socket & > operator=( basic_raw_socket< Protocol1, Executor1 > && other); @@ -30767,10 +31291,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -30778,11 +31302,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -30898,7 +31422,7 @@ The receive operation can only be used with a connected socket. Use the receive\ To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.receive(asio::buffer(data, size)); + socket.receive(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -31033,10 +31557,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -31044,11 +31568,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -31144,9 +31668,9 @@ The number of bytes received. To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::ip::udp::endpoint sender_endpoint; - socket.receive_from( - asio::buffer(data, size), sender_endpoint); + asio::ip::udp::endpoint sender_endpoint; + socket.receive_from( + asio::buffer(data, size), sender_endpoint); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -31277,10 +31801,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -31288,11 +31812,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -31446,9 +31970,9 @@ An object that represents the remote endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -31495,14 +32019,14 @@ An object that represents the remote endpoint of the socket. Returns a default-c - 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. - } + 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. + } @@ -31536,10 +32060,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -31547,11 +32071,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -31646,7 +32170,7 @@ The send operation can only be used with a connected socket. Use the send\_to fu To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.send(asio::buffer(data, size)); + socket.send(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -31781,10 +32305,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -31792,11 +32316,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -31835,10 +32359,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -31846,11 +32370,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -31946,9 +32470,9 @@ The number of bytes sent. To send a single data buffer use the [link asio.reference.buffer `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); + 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 [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -32121,10 +32645,10 @@ This function is used to set an option on the socket. 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option(true); + socket.set_option(option); @@ -32172,15 +32696,15 @@ This function is used to set an option on the socket. 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. - } + 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. + } @@ -32249,9 +32773,9 @@ This function is used to disable send operations, receive operations, or both. Shutting down the send side of the socket: - asio::ip::tcp::socket socket(my_context); - ... - socket.shutdown(asio::ip::tcp::socket::shutdown_send); + asio::ip::tcp::socket socket(my_context); + ... + socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -32296,14 +32820,14 @@ This function is used to disable send operations, receive operations, or both. 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. - } + 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. + } @@ -32402,9 +32926,9 @@ This function is used to perform a blocking wait for a socket to enter a ready t Waiting for a socket to become readable. - asio::ip::tcp::socket socket(my_context); - ... - socket.wait(asio::ip::tcp::socket::wait_read); + asio::ip::tcp::socket socket(my_context); + ... + socket.wait(asio::ip::tcp::socket::wait_read); @@ -32449,10 +32973,10 @@ This function is used to perform a blocking wait for a socket to enter a ready t 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -33190,10 +33714,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the pipe. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -33209,9 +33733,9 @@ This function is used to asynchronously read data from the pipe. It is an initia [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -33222,7 +33746,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -33237,8 +33761,8 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - basic_readable_pipe.async_read_some( - asio::buffer(data, size), handler); + basic_readable_pipe.async_read_some( + asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -33263,7 +33787,7 @@ Construct a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] with typename ExecutionContext> explicit ``[link asio.reference.basic_readable_pipe.basic_readable_pipe.overload2 basic_readable_pipe]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_readable_pipe.basic_readable_pipe.overload2 more...]]`` @@ -33280,7 +33804,7 @@ Construct a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] on a ``[link asio.reference.basic_readable_pipe.basic_readable_pipe.overload4 basic_readable_pipe]``( ExecutionContext & context, const native_handle_type & native_pipe, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_readable_pipe.basic_readable_pipe.overload4 more...]]`` @@ -33299,7 +33823,7 @@ Move-construct a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_readable_pipe.basic_readable_pipe.overload6 basic_readable_pipe]``( basic_readable_pipe< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_readable_pipe.basic_readable_pipe.overload6 more...]]`` @@ -33342,7 +33866,7 @@ Construct a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] with typename ExecutionContext> basic_readable_pipe( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a pipe without opening it. @@ -33417,7 +33941,7 @@ Construct a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] on a basic_readable_pipe( ExecutionContext & context, const native_handle_type & native_pipe, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a pipe object to hold an existing native pipe. @@ -33495,7 +34019,7 @@ Move-construct a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] typename ``[link asio.reference.Executor1 Executor1]``> basic_readable_pipe( basic_readable_pipe< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a pipe from one object to another. @@ -33980,7 +34504,7 @@ Move-assign a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] fr template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_readable_pipe & >::type ``[link asio.reference.basic_readable_pipe.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_readable_pipe & > ``[link asio.reference.basic_readable_pipe.operator_eq_.overload2 operator=]``( basic_readable_pipe< Executor1 > && other); `` [''''»''' [link asio.reference.basic_readable_pipe.operator_eq_.overload2 more...]]`` @@ -34027,7 +34551,7 @@ Move-assign a [link asio.reference.basic_readable_pipe `basic_readable_pipe`] fr template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_readable_pipe & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_readable_pipe & > operator=( basic_readable_pipe< Executor1 > && other); @@ -34125,7 +34649,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - basic_readable_pipe.read_some(asio::buffer(data, size)); + basic_readable_pipe.read_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -34943,10 +35467,10 @@ Start an asynchronous connect. template< - typename ``[link asio.reference.ConnectToken ConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.ConnectToken ConnectToken]`` = default_completion_token_t> + auto async_connect( const endpoint_type & peer_endpoint, - ConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ConnectToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously connect a socket to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -34964,8 +35488,8 @@ The socket is automatically opened if it is not already open. If the connect fai [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -34976,7 +35500,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -34986,20 +35510,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void connect_handler(const asio::error_code& error) - { - if (!error) - { - // Connect succeeded. - } - } + 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); + 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); @@ -35032,21 +35556,21 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_seq_packet_socket.async_receive.overload1 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_seq_packet_socket.async_receive.overload1 async_receive]``( const MutableBufferSequence & buffers, socket_base::message_flags & out_flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_seq_packet_socket.async_receive.overload1 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_seq_packet_socket.async_receive.overload2 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_seq_packet_socket.async_receive.overload2 async_receive]``( const MutableBufferSequence & buffers, socket_base::message_flags in_flags, socket_base::message_flags & out_flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_seq_packet_socket.async_receive.overload2 more...]]`` @@ -35058,11 +35582,11 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, socket_base::message_flags & out_flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the sequenced packet socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -35080,9 +35604,9 @@ This function is used to asynchronously receive data from the sequenced packet s [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -35093,7 +35617,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -35103,7 +35627,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive(asio::buffer(data, size), out_flags, handler); + socket.async_receive(asio::buffer(data, size), out_flags, handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -35137,12 +35661,12 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, socket_base::message_flags in_flags, socket_base::message_flags & out_flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the sequenced data socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -35162,9 +35686,9 @@ This function is used to asynchronously receive data from the sequenced data soc [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -35175,7 +35699,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -35185,9 +35709,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive( - asio::buffer(data, size), - 0, out_flags, handler); + socket.async_receive( + asio::buffer(data, size), + 0, out_flags, handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -35223,11 +35747,11 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the sequenced packet socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -35245,9 +35769,9 @@ This function is used to asynchronously send data on the sequenced packet socket [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -35258,7 +35782,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -35268,7 +35792,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_send(asio::buffer(data, size), 0, handler); + socket.async_send(asio::buffer(data, size), 0, handler); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -35304,10 +35828,10 @@ Asynchronously wait for the socket to become ready to read, ready to write, or t template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -35323,8 +35847,8 @@ This function is used to perform an asynchronous wait for a socket to enter a re [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -35335,7 +35859,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -35345,19 +35869,19 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::ip::tcp::socket socket(my_context); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -35572,7 +36096,7 @@ Construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socke typename ExecutionContext> explicit ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload2 basic_seq_packet_socket]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload2 more...]]`` @@ -35589,7 +36113,7 @@ Construct and open a [link asio.reference.basic_seq_packet_socket `basic_seq_pac ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload4 basic_seq_packet_socket]``( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload4 more...]]`` @@ -35606,7 +36130,7 @@ Construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socke ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload6 basic_seq_packet_socket]``( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload6 more...]]`` @@ -35625,7 +36149,7 @@ Construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socke ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload8 more...]]`` @@ -35645,7 +36169,7 @@ Move-construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_ typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload10 basic_seq_packet_socket]``( basic_seq_packet_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload10 more...]]`` @@ -35688,7 +36212,7 @@ Construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socke typename ExecutionContext> basic_seq_packet_socket( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -35763,7 +36287,7 @@ Construct and open a [link asio.reference.basic_seq_packet_socket `basic_seq_pac basic_seq_packet_socket( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); 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. @@ -35850,7 +36374,7 @@ Construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socke basic_seq_packet_socket( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -35941,7 +36465,7 @@ Construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socke ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a sequenced packet socket object to hold an existing native socket. @@ -36022,7 +36546,7 @@ Move-construct a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_ typename ``[link asio.reference.Executor1 Executor1]``> basic_seq_packet_socket( basic_seq_packet_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); This constructor moves a sequenced packet socket from one object to another. @@ -36106,10 +36630,10 @@ This function binds the socket to the specified endpoint on the local machine. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); - socket.bind(asio::ip::tcp::endpoint( - asio::ip::tcp::v4(), 12345)); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); + socket.bind(asio::ip::tcp::endpoint( + asio::ip::tcp::v4(), 12345)); @@ -36154,15 +36678,15 @@ This function binds the socket to the specified endpoint on the local machine. - 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. - } + 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. + } @@ -36196,10 +36720,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -36207,11 +36731,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -36250,11 +36774,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -36468,14 +36992,14 @@ This function is used to close the socket. Any asynchronous send, receive or con - asio::ip::tcp::socket socket(my_context); - ... - asio::error_code ec; - socket.close(ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.close(ec); + if (ec) + { + // An error occurred. + } @@ -36551,10 +37075,10 @@ The socket is automatically opened if it is not already open. If the connect fai - 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); + 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); @@ -36601,15 +37125,15 @@ The socket is automatically opened if it is not already open. If the connect fai - 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. - } + 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. + } @@ -36643,10 +37167,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -36654,11 +37178,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -36697,10 +37221,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -36708,11 +37232,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -36751,10 +37275,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -36762,11 +37286,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -36906,11 +37430,11 @@ This function is used to get the current value of an option on the socket. 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::socket::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -36958,16 +37482,16 @@ This function is used to get the current value of an option on the socket. 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(); + 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(); @@ -37043,11 +37567,11 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -37095,16 +37619,16 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -37155,10 +37679,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -37166,11 +37690,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -37209,10 +37733,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -37220,12 +37744,12 @@ Setting the 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(); + 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(); @@ -37291,9 +37815,9 @@ An object that represents the local endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -37340,14 +37864,14 @@ An object that represents the local endpoint of the socket. Returns a default-co - 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. - } + 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. + } @@ -38045,69 +38569,69 @@ The current non-blocking mode is cached by the socket object. Consequently, the 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -38160,69 +38684,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -38268,69 +38792,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -38535,8 +39059,8 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); @@ -38581,13 +39105,13 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - asio::error_code ec; - socket.open(asio::ip::tcp::v4(), ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + asio::error_code ec; + socket.open(asio::ip::tcp::v4(), ec); + if (ec) + { + // An error occurred. + } @@ -38617,7 +39141,7 @@ Move-assign a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_soc template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_seq_packet_socket & >::type ``[link asio.reference.basic_seq_packet_socket.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_seq_packet_socket & > ``[link asio.reference.basic_seq_packet_socket.operator_eq_.overload2 operator=]``( basic_seq_packet_socket< Protocol1, Executor1 > && other); `` [''''»''' [link asio.reference.basic_seq_packet_socket.operator_eq_.overload2 more...]]`` @@ -38665,7 +39189,7 @@ Move-assign a [link asio.reference.basic_seq_packet_socket `basic_seq_packet_soc template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_seq_packet_socket & >::type operator=( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_seq_packet_socket & > operator=( basic_seq_packet_socket< Protocol1, Executor1 > && other); @@ -38715,10 +39239,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -38726,11 +39250,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -38851,7 +39375,7 @@ The number of bytes received. To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.receive(asio::buffer(data, size), out_flags); + socket.receive(asio::buffer(data, size), out_flags); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -38918,7 +39442,7 @@ The receive operation may not receive all of the requested number of bytes. Cons To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.receive(asio::buffer(data, size), 0, out_flags); + socket.receive(asio::buffer(data, size), 0, out_flags); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -39002,10 +39526,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -39013,11 +39537,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -39056,10 +39580,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -39067,11 +39591,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -39225,9 +39749,9 @@ An object that represents the remote endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -39274,14 +39798,14 @@ An object that represents the remote endpoint of the socket. Returns a default-c - 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. - } + 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. + } @@ -39315,10 +39839,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -39326,11 +39850,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -39417,7 +39941,7 @@ The number of bytes sent. To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.send(asio::buffer(data, size), 0); + socket.send(asio::buffer(data, size), 0); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -39498,10 +40022,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -39509,11 +40033,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -39552,10 +40076,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -39563,11 +40087,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -39648,10 +40172,10 @@ This function is used to set an option on the socket. 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option(true); + socket.set_option(option); @@ -39699,15 +40223,15 @@ This function is used to set an option on the socket. 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. - } + 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. + } @@ -39776,9 +40300,9 @@ This function is used to disable send operations, receive operations, or both. Shutting down the send side of the socket: - asio::ip::tcp::socket socket(my_context); - ... - socket.shutdown(asio::ip::tcp::socket::shutdown_send); + asio::ip::tcp::socket socket(my_context); + ... + socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -39823,14 +40347,14 @@ This function is used to disable send operations, receive operations, or both. 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. - } + 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. + } @@ -39929,9 +40453,9 @@ This function is used to perform a blocking wait for a socket to enter a ready t Waiting for a socket to become readable. - asio::ip::tcp::socket socket(my_context); - ... - socket.wait(asio::ip::tcp::socket::wait_read); + asio::ip::tcp::socket socket(my_context); + ... + socket.wait(asio::ip::tcp::socket::wait_read); @@ -39976,10 +40500,10 @@ This function is used to perform a blocking wait for a socket to enter a ready t 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -40727,10 +41251,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the serial port. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -40746,9 +41270,9 @@ This function is used to asynchronously read data from the serial port. It is an [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -40759,7 +41283,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -40774,8 +41298,8 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - basic_serial_port.async_read_some( - asio::buffer(data, size), handler); + basic_serial_port.async_read_some( + asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -40809,10 +41333,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the serial port. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -40828,9 +41352,9 @@ This function is used to asynchronously write data to the serial port. It is an [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -40841,7 +41365,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -40856,8 +41380,8 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - basic_serial_port.async_write_some( - asio::buffer(data, size), handler); + basic_serial_port.async_write_some( + asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -40896,7 +41420,7 @@ Construct a [link asio.reference.basic_serial_port `basic_serial_port`] without typename ExecutionContext> explicit ``[link asio.reference.basic_serial_port.basic_serial_port.overload2 basic_serial_port]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload2 more...]]`` @@ -40913,7 +41437,7 @@ Construct and open a [link asio.reference.basic_serial_port `basic_serial_port`] ``[link asio.reference.basic_serial_port.basic_serial_port.overload4 basic_serial_port]``( ExecutionContext & context, const char * device, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload4 more...]]`` ``[link asio.reference.basic_serial_port.basic_serial_port.overload5 basic_serial_port]``( @@ -40926,7 +41450,7 @@ Construct and open a [link asio.reference.basic_serial_port `basic_serial_port`] ``[link asio.reference.basic_serial_port.basic_serial_port.overload6 basic_serial_port]``( ExecutionContext & context, const std::string & device, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload6 more...]]`` @@ -40943,7 +41467,7 @@ Construct a [link asio.reference.basic_serial_port `basic_serial_port`] on an ex ``[link asio.reference.basic_serial_port.basic_serial_port.overload8 basic_serial_port]``( ExecutionContext & context, const native_handle_type & native_serial_port, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload8 more...]]`` @@ -40962,7 +41486,7 @@ Move-construct a [link asio.reference.basic_serial_port `basic_serial_port`] fro typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_serial_port.basic_serial_port.overload10 basic_serial_port]``( basic_serial_port< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload10 more...]]`` @@ -41005,7 +41529,7 @@ Construct a [link asio.reference.basic_serial_port `basic_serial_port`] without typename ExecutionContext> basic_serial_port( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a serial port without opening it. @@ -41070,7 +41594,7 @@ Construct and open a [link asio.reference.basic_serial_port `basic_serial_port`] basic_serial_port( ExecutionContext & context, const char * device, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates and opens a serial port for the specified device name. @@ -41137,7 +41661,7 @@ Construct and open a [link asio.reference.basic_serial_port `basic_serial_port`] basic_serial_port( ExecutionContext & context, const std::string & device, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates and opens a serial port for the specified device name. @@ -41214,7 +41738,7 @@ Construct a [link asio.reference.basic_serial_port `basic_serial_port`] on an ex basic_serial_port( ExecutionContext & context, const native_handle_type & native_serial_port, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a serial port object to hold an existing native serial port. @@ -41292,7 +41816,7 @@ Move-construct a [link asio.reference.basic_serial_port `basic_serial_port`] fro typename ``[link asio.reference.Executor1 Executor1]``> basic_serial_port( basic_serial_port< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a serial port from one object to another. @@ -41990,7 +42514,7 @@ Move-assign a [link asio.reference.basic_serial_port `basic_serial_port`] from a template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_serial_port & >::type ``[link asio.reference.basic_serial_port.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_serial_port & > ``[link asio.reference.basic_serial_port.operator_eq_.overload2 operator=]``( basic_serial_port< Executor1 > && other); `` [''''»''' [link asio.reference.basic_serial_port.operator_eq_.overload2 more...]]`` @@ -42037,7 +42561,7 @@ Move-assign a [link asio.reference.basic_serial_port `basic_serial_port`] from a template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_serial_port & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_serial_port & > operator=( basic_serial_port< Executor1 > && other); @@ -42135,7 +42659,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - basic_serial_port.read_some(asio::buffer(data, size)); + basic_serial_port.read_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -42431,7 +42955,7 @@ The write\_some operation may not transmit all of the data to the peer. Consider To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - basic_serial_port.write_some(asio::buffer(data, size)); + basic_serial_port.write_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -42832,23 +43356,23 @@ The [link asio.reference.basic_signal_set `basic_signal_set`] class provides the Performing an asynchronous wait: - void handler( - const asio::error_code& error, - int signal_number) - { - if (!error) - { - // A signal occurred. - } - } + 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); + // 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); + // Start an asynchronous wait for one of the signals to occur. + signals.async_wait(handler); @@ -42999,9 +43523,9 @@ Add a signal to a signal\_set with the specified flags. This function adds the specified signal to the set. It has no effect if the signal is already in the set. -Flags other than flags::dont\_care require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. +Flags other than `flags::dont_care` require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. -The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than flags::dont\_care. In this case, the `add` will fail with `error::invalid_argument`. +The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than `flags::dont_care`. In this case, the `add` will fail with `error::invalid_argument`. [heading Parameters] @@ -43046,9 +43570,9 @@ Add a signal to a signal\_set with the specified flags. This function adds the specified signal to the set. It has no effect if the signal is already in the set. -Flags other than flags::dont\_care require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. +Flags other than `flags::dont_care` require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. -The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than flags::dont\_care. In this case, the `add` will fail with `error::invalid_argument`. +The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than `flags::dont_care`. In this case, the `add` will fail with `error::invalid_argument`. [heading Parameters] @@ -43080,9 +43604,9 @@ Start an asynchronous operation to wait for a signal to be delivered. template< - typename ``[link asio.reference.SignalToken SignalToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( - SignalToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.SignalToken SignalToken]`` = default_completion_token_t> + auto async_wait( + SignalToken && token = default_completion_token_t< executor_type >()); This function may be used to initiate an asynchronous wait against the signal set. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -43104,9 +43628,9 @@ For each call to `async_wait()`, the completion handler will be called exactly o [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - int signal_number // Indicates which signal occurred. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -43117,7 +43641,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, int) + void(asio::error_code, int) @@ -43156,7 +43680,7 @@ Construct a signal set without adding any signals. typename ExecutionContext> explicit ``[link asio.reference.basic_signal_set.basic_signal_set.overload2 basic_signal_set]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload2 more...]]`` @@ -43173,7 +43697,7 @@ Construct a signal set and add one signal. ``[link asio.reference.basic_signal_set.basic_signal_set.overload4 basic_signal_set]``( ExecutionContext & context, int signal_number_1, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload4 more...]]`` @@ -43192,7 +43716,7 @@ Construct a signal set and add two signals. ExecutionContext & context, int signal_number_1, int signal_number_2, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload6 more...]]`` @@ -43213,7 +43737,7 @@ Construct a signal set and add three signals. int signal_number_1, int signal_number_2, int signal_number_3, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload8 more...]]`` @@ -43256,7 +43780,7 @@ Construct a signal set without adding any signals. typename ExecutionContext> basic_signal_set( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a signal set without registering for any signals. @@ -43309,7 +43833,7 @@ This constructor creates a signal set and registers for one signal. This constructor is equivalent to performing: asio::signal_set signals(ex); - signals.add(signal_number_1); + signals.add(signal_number_1); @@ -43332,7 +43856,7 @@ Construct a signal set and add one signal. basic_signal_set( ExecutionContext & context, int signal_number_1, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a signal set and registers for one signal. @@ -43355,7 +43879,7 @@ This constructor creates a signal set and registers for one signal. This constructor is equivalent to performing: asio::signal_set signals(context); - signals.add(signal_number_1); + signals.add(signal_number_1); @@ -43401,8 +43925,8 @@ This constructor creates a signal set and registers for two signals. 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_1); + signals.add(signal_number_2); @@ -43426,7 +43950,7 @@ Construct a signal set and add two signals. ExecutionContext & context, int signal_number_1, int signal_number_2, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a signal set and registers for two signals. @@ -43451,8 +43975,8 @@ This constructor creates a signal set and registers for two signals. 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_1); + signals.add(signal_number_2); @@ -43501,9 +44025,9 @@ This constructor creates a signal set and registers for three signals. 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); + signals.add(signal_number_1); + signals.add(signal_number_2); + signals.add(signal_number_3); @@ -43528,7 +44052,7 @@ Construct a signal set and add three signals. int signal_number_1, int signal_number_2, int signal_number_3, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a signal set and registers for three signals. @@ -43555,9 +44079,9 @@ This constructor creates a signal set and registers for three signals. 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); + signals.add(signal_number_1); + signals.add(signal_number_2); + signals.add(signal_number_3); @@ -44122,23 +44646,23 @@ The [link asio.reference.basic_signal_set `basic_signal_set`] class provides the Performing an asynchronous wait: - void handler( - const asio::error_code& error, - int signal_number) - { - if (!error) - { - // A signal occurred. - } - } + 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); + // 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); + // Start an asynchronous wait for one of the signals to occur. + signals.async_wait(handler); @@ -44635,10 +45159,10 @@ Start an asynchronous connect. template< - typename ``[link asio.reference.ConnectToken ConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.ConnectToken ConnectToken]`` = default_completion_token_t> + auto async_connect( const endpoint_type & peer_endpoint, - ConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ConnectToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously connect a socket to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -44656,8 +45180,8 @@ The socket is automatically opened if it is not already open. If the connect fai [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -44668,7 +45192,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -44678,20 +45202,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void connect_handler(const asio::error_code& error) - { - if (!error) - { - // Connect succeeded. - } - } + 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); + 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); @@ -44724,10 +45248,10 @@ Asynchronously wait for the socket to become ready to read, ready to write, or t template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -44743,8 +45267,8 @@ This function is used to perform an asynchronous wait for a socket to enter a re [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -44755,7 +45279,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -44765,19 +45289,19 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::ip::tcp::socket socket(my_context); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -44980,7 +45504,7 @@ Construct a [link asio.reference.basic_socket `basic_socket`] without opening it typename ExecutionContext> explicit ``[link asio.reference.basic_socket.basic_socket.overload2 basic_socket]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload2 more...]]`` @@ -44997,7 +45521,7 @@ Construct and open a [link asio.reference.basic_socket `basic_socket`]. ``[link asio.reference.basic_socket.basic_socket.overload4 basic_socket]``( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload4 more...]]`` @@ -45014,7 +45538,7 @@ Construct a [link asio.reference.basic_socket `basic_socket`], opening it and bi ``[link asio.reference.basic_socket.basic_socket.overload6 basic_socket]``( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload6 more...]]`` @@ -45033,7 +45557,7 @@ Construct a [link asio.reference.basic_socket `basic_socket`] on an existing nat ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload8 more...]]`` @@ -45053,7 +45577,7 @@ Move-construct a [link asio.reference.basic_socket `basic_socket`] from a socket typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_socket.basic_socket.overload10 basic_socket]``( basic_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload10 more...]]`` @@ -45096,7 +45620,7 @@ Construct a [link asio.reference.basic_socket `basic_socket`] without opening it typename ExecutionContext> basic_socket( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a socket without opening it. @@ -45171,7 +45695,7 @@ Construct and open a [link asio.reference.basic_socket `basic_socket`]. basic_socket( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates and opens a socket. @@ -45258,7 +45782,7 @@ Construct a [link asio.reference.basic_socket `basic_socket`], opening it and bi basic_socket( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -45349,7 +45873,7 @@ Construct a [link asio.reference.basic_socket `basic_socket`] on an existing nat ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a socket object to hold an existing native socket. @@ -45410,7 +45934,7 @@ This constructor moves a socket from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&)` constructor. @@ -45430,7 +45954,7 @@ Move-construct a [link asio.reference.basic_socket `basic_socket`] from a socket typename ``[link asio.reference.Executor1 Executor1]``> basic_socket( basic_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); This constructor moves a socket from one object to another. @@ -45448,7 +45972,7 @@ This constructor moves a socket from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&)` constructor. @@ -45511,10 +46035,10 @@ This function binds the socket to the specified endpoint on the local machine. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); - socket.bind(asio::ip::tcp::endpoint( - asio::ip::tcp::v4(), 12345)); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); + socket.bind(asio::ip::tcp::endpoint( + asio::ip::tcp::v4(), 12345)); @@ -45556,15 +46080,15 @@ This function binds the socket to the specified endpoint on the local machine. - 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. - } + 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. + } @@ -45598,10 +46122,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -45609,11 +46133,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -45652,11 +46176,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -45858,14 +46382,14 @@ This function is used to close the socket. Any asynchronous send, receive or con - asio::ip::tcp::socket socket(my_context); - ... - asio::error_code ec; - socket.close(ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.close(ec); + if (ec) + { + // An error occurred. + } @@ -45938,10 +46462,10 @@ The socket is automatically opened if it is not already open. If the connect fai - 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); + 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); @@ -45985,15 +46509,15 @@ The socket is automatically opened if it is not already open. If the connect fai - 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. - } + 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. + } @@ -46027,10 +46551,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -46038,11 +46562,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -46081,10 +46605,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -46092,11 +46616,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -46135,10 +46659,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -46146,11 +46670,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -46284,11 +46808,11 @@ This function is used to get the current value of an option on the socket. 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::socket::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -46333,16 +46857,16 @@ This function is used to get the current value of an option on the socket. 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(); + 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(); @@ -46415,11 +46939,11 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -46464,16 +46988,16 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -46521,10 +47045,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -46532,11 +47056,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -46575,10 +47099,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -46586,12 +47110,12 @@ Setting the 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(); + 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(); @@ -46654,9 +47178,9 @@ An object that represents the local endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -46700,14 +47224,14 @@ An object that represents the local endpoint of the socket. Returns a default-co - 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. - } + 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. + } @@ -47390,69 +47914,69 @@ The current non-blocking mode is cached by the socket object. Consequently, the 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -47502,69 +48026,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -47607,69 +48131,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -47862,8 +48386,8 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); @@ -47905,13 +48429,13 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - asio::error_code ec; - socket.open(asio::ip::tcp::v4(), ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + asio::error_code ec; + socket.open(asio::ip::tcp::v4(), ec); + if (ec) + { + // An error occurred. + } @@ -47941,7 +48465,7 @@ Move-assign a [link asio.reference.basic_socket `basic_socket`] from a socket of template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket & >::type ``[link asio.reference.basic_socket.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket & > ``[link asio.reference.basic_socket.operator_eq_.overload2 operator=]``( basic_socket< Protocol1, Executor1 > && other); `` [''''»''' [link asio.reference.basic_socket.operator_eq_.overload2 more...]]`` @@ -47971,7 +48495,7 @@ This assignment operator moves a socket from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&)` constructor. @@ -47989,7 +48513,7 @@ Move-assign a [link asio.reference.basic_socket `basic_socket`] from a socket of template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket & >::type operator=( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket & > operator=( basic_socket< Protocol1, Executor1 > && other); @@ -48008,7 +48532,7 @@ This assignment operator moves a socket from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(const executor_type&)` constructor. @@ -48039,10 +48563,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -48050,11 +48574,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -48114,10 +48638,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -48125,11 +48649,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -48168,10 +48692,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -48179,11 +48703,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -48328,9 +48852,9 @@ An object that represents the remote endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -48374,14 +48898,14 @@ An object that represents the remote endpoint of the socket. Returns a default-c - 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. - } + 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. + } @@ -48415,10 +48939,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -48426,11 +48950,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -48469,10 +48993,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -48480,11 +49004,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -48523,10 +49047,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -48534,11 +49058,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -48616,10 +49140,10 @@ This function is used to set an option on the socket. 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option(true); + socket.set_option(option); @@ -48664,15 +49188,15 @@ This function is used to set an option on the socket. 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. - } + 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. + } @@ -48738,9 +49262,9 @@ This function is used to disable send operations, receive operations, or both. Shutting down the send side of the socket: - asio::ip::tcp::socket socket(my_context); - ... - socket.shutdown(asio::ip::tcp::socket::shutdown_send); + asio::ip::tcp::socket socket(my_context); + ... + socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -48782,14 +49306,14 @@ This function is used to disable send operations, receive operations, or both. 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. - } + 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. + } @@ -48885,9 +49409,9 @@ This function is used to perform a blocking wait for a socket to enter a ready t Waiting for a socket to become readable. - asio::ip::tcp::socket socket(my_context); - ... - socket.wait(asio::ip::tcp::socket::wait_read); + asio::ip::tcp::socket socket(my_context); + ... + socket.wait(asio::ip::tcp::socket::wait_read); @@ -48929,10 +49453,10 @@ This function is used to perform a blocking wait for a socket to enter a ready t 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -49793,12 +50317,12 @@ Synchronous `accept` operations are thread safe, if the underlying operating sys 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(); + 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(); @@ -49822,7 +50346,7 @@ Accept a new connection. typename ``[link asio.reference.Executor1 Executor1]``> void ``[link asio.reference.basic_socket_acceptor.accept.overload1 accept]``( basic_socket< Protocol1, Executor1 > & peer, - typename constraint< is_convertible< Protocol, Protocol1 >::value >::type = 0); + constraint_t< is_convertible< Protocol, Protocol1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload1 more...]]`` template< @@ -49831,7 +50355,7 @@ Accept a new connection. void ``[link asio.reference.basic_socket_acceptor.accept.overload2 accept]``( basic_socket< Protocol1, Executor1 > & peer, asio::error_code & ec, - typename constraint< is_convertible< Protocol, Protocol1 >::value >::type = 0); + constraint_t< is_convertible< Protocol, Protocol1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload2 more...]]`` @@ -49864,14 +50388,14 @@ Accept a new connection and obtain the endpoint of the peer. typename ``[link asio.reference.Executor1 Executor1]``> Protocol::socket::template rebind_executor< Executor1 >::other ``[link asio.reference.basic_socket_acceptor.accept.overload7 accept]``( const Executor1 & ex, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload7 more...]]`` template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload8 accept]``( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload8 accept]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload8 more...]]`` template< @@ -49879,15 +50403,15 @@ Accept a new connection and obtain the endpoint of the peer. Protocol::socket::template rebind_executor< Executor1 >::other ``[link asio.reference.basic_socket_acceptor.accept.overload9 accept]``( const Executor1 & ex, asio::error_code & ec, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload9 more...]]`` template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload10 accept]``( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload10 accept]``( ExecutionContext & context, asio::error_code & ec, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload10 more...]]`` Protocol::socket::template rebind_executor< executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload11 accept]``( @@ -49904,15 +50428,15 @@ Accept a new connection and obtain the endpoint of the peer. Protocol::socket::template rebind_executor< Executor1 >::other ``[link asio.reference.basic_socket_acceptor.accept.overload13 accept]``( const Executor1 & ex, endpoint_type & peer_endpoint, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload13 more...]]`` template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload14 accept]``( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload14 accept]``( ExecutionContext & context, endpoint_type & peer_endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload14 more...]]`` template< @@ -49921,16 +50445,16 @@ Accept a new connection and obtain the endpoint of the peer. const executor_type & ex, endpoint_type & peer_endpoint, asio::error_code & ec, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload15 more...]]`` template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload16 accept]``( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other ``[link asio.reference.basic_socket_acceptor.accept.overload16 accept]``( ExecutionContext & context, endpoint_type & peer_endpoint, asio::error_code & ec, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload16 more...]]`` @@ -49945,7 +50469,7 @@ Accept a new connection. typename ``[link asio.reference.Executor1 Executor1]``> void accept( basic_socket< Protocol1, Executor1 > & peer, - typename constraint< is_convertible< Protocol, Protocol1 >::value >::type = 0); + constraint_t< is_convertible< Protocol, Protocol1 >::value > = 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. @@ -49975,10 +50499,10 @@ This function is used to accept a new connection from a peer into the given sock - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(my_context); - acceptor.accept(socket); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(my_context); + acceptor.accept(socket); @@ -50002,7 +50526,7 @@ Accept a new connection. void accept( basic_socket< Protocol1, Executor1 > & peer, asio::error_code & ec, - typename constraint< is_convertible< Protocol, Protocol1 >::value >::type = 0); + constraint_t< is_convertible< Protocol, Protocol1 >::value > = 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. @@ -50024,15 +50548,15 @@ This function is used to accept a new connection from a peer into the given sock - 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. - } + 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. + } @@ -50086,11 +50610,11 @@ This function is used to accept a new connection from a peer into the given sock - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(my_context); - asio::ip::tcp::endpoint endpoint; - acceptor.accept(socket, endpoint); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(my_context); + asio::ip::tcp::endpoint endpoint; + acceptor.accept(socket, endpoint); @@ -50137,16 +50661,16 @@ This function is used to accept a new connection from a peer into the given sock - 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. - } + 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. + } @@ -50191,9 +50715,9 @@ A socket object representing the newly accepted connection. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(acceptor.accept()); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(acceptor.accept()); @@ -50239,13 +50763,13 @@ On success, a socket object representing the newly accepted connection. On error - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(acceptor.accept(ec)); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(acceptor.accept(ec)); + if (ec) + { + // An error occurred. + } @@ -50267,7 +50791,7 @@ Accept a new connection. typename ``[link asio.reference.Executor1 Executor1]``> Protocol::socket::template rebind_executor< Executor1 >::other accept( const Executor1 & ex, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 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. @@ -50304,9 +50828,9 @@ A socket object representing the newly accepted connection. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(acceptor.accept()); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(acceptor.accept()); @@ -50326,9 +50850,9 @@ Accept a new connection. template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other accept( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -50365,9 +50889,9 @@ A socket object representing the newly accepted connection. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(acceptor.accept()); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(acceptor.accept()); @@ -50390,7 +50914,7 @@ Accept a new connection. Protocol::socket::template rebind_executor< Executor1 >::other accept( const Executor1 & ex, asio::error_code & ec, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 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. @@ -50419,13 +50943,13 @@ On success, a socket object representing the newly accepted connection. On error - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec)); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec)); + if (ec) + { + // An error occurred. + } @@ -50445,10 +50969,10 @@ Accept a new connection. template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other accept( ExecutionContext & context, asio::error_code & ec, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -50477,13 +51001,13 @@ On success, a socket object representing the newly accepted connection. On error - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec)); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec)); + if (ec) + { + // An error occurred. + } @@ -50539,10 +51063,10 @@ A socket object representing the newly accepted connection. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::endpoint endpoint; - asio::ip::tcp::socket socket(acceptor.accept(endpoint)); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket(acceptor.accept(endpoint)); @@ -50591,14 +51115,14 @@ On success, a socket object representing the newly accepted connection. On error - 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. - } + 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. + } @@ -50621,7 +51145,7 @@ Accept a new connection. Protocol::socket::template rebind_executor< Executor1 >::other accept( const Executor1 & ex, endpoint_type & peer_endpoint, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 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. @@ -50660,11 +51184,11 @@ A socket object representing the newly accepted connection. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::endpoint endpoint; - asio::ip::tcp::socket socket( - acceptor.accept(my_context2, endpoint)); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket( + acceptor.accept(my_context2, endpoint)); @@ -50684,10 +51208,10 @@ Accept a new connection. template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other accept( ExecutionContext & context, endpoint_type & peer_endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -50726,11 +51250,11 @@ A socket object representing the newly accepted connection. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::endpoint endpoint; - asio::ip::tcp::socket socket( - acceptor.accept(my_context2, endpoint)); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket( + acceptor.accept(my_context2, endpoint)); @@ -50754,7 +51278,7 @@ Accept a new connection. const executor_type & ex, endpoint_type & peer_endpoint, asio::error_code & ec, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 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. @@ -50785,15 +51309,15 @@ On success, a socket object representing the newly accepted connection. On error - 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. - } + 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. + } @@ -50813,11 +51337,11 @@ Accept a new connection. template< typename ExecutionContext> - Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept( + Protocol::socket::template rebind_executor< typenameExecutionContext::executor_type >::other accept( ExecutionContext & context, endpoint_type & peer_endpoint, asio::error_code & ec, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -50848,15 +51372,15 @@ On success, a socket object representing the newly accepted connection. On error - 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. - } + 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. + } @@ -50930,71 +51454,71 @@ Start an asynchronous accept. template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.AcceptToken AcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload1 async_accept]``( + typename ``[link asio.reference.AcceptToken AcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload1 async_accept]``( basic_socket< Protocol1, Executor1 > & peer, - AcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< Protocol, Protocol1 >::value >::type = 0); + AcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_convertible< Protocol, Protocol1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload1 more...]]`` template< typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.AcceptToken AcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload2 async_accept]``( + typename ``[link asio.reference.AcceptToken AcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload2 async_accept]``( basic_socket< protocol_type, Executor1 > & peer, endpoint_type & peer_endpoint, - AcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + AcceptToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload2 more...]]`` template< - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload3 async_accept]``( - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload3 async_accept]``( + MoveAcceptToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload3 more...]]`` template< typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload4 async_accept]``( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload4 async_accept]``( const Executor1 & ex, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload4 more...]]`` template< typename ExecutionContext, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload5 async_accept]``( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload5 async_accept]``( ExecutionContext & context, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload5 more...]]`` template< - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload6 async_accept]``( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload6 async_accept]``( endpoint_type & peer_endpoint, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + MoveAcceptToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload6 more...]]`` template< typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload7 async_accept]``( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload7 async_accept]``( const Executor1 & ex, endpoint_type & peer_endpoint, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload7 more...]]`` template< typename ExecutionContext, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload8 async_accept]``( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_socket_acceptor.async_accept.overload8 async_accept]``( ExecutionContext & context, endpoint_type & peer_endpoint, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload8 more...]]`` @@ -51007,11 +51531,11 @@ Start an asynchronous accept. template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.AcceptToken AcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.AcceptToken AcceptToken]`` = default_completion_token_t> + auto async_accept( basic_socket< Protocol1, Executor1 > & peer, - AcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< Protocol, Protocol1 >::value >::type = 0); + AcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_convertible< Protocol, Protocol1 >::value > = 0); This function is used to asynchronously accept a new connection into a socket, and additionally obtain the endpoint of the remote peer. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51027,8 +51551,8 @@ This function is used to asynchronously accept a new connection into a socket, a [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51039,7 +51563,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -51049,20 +51573,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::socket socket(my_context); + acceptor.async_accept(socket, accept_handler); @@ -51096,11 +51620,11 @@ Start an asynchronous accept. template< typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.AcceptToken AcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.AcceptToken AcceptToken]`` = default_completion_token_t> + auto async_accept( basic_socket< protocol_type, Executor1 > & peer, endpoint_type & peer_endpoint, - AcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + AcceptToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously accept a new connection into a socket, and additionally obtain the endpoint of the remote peer. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51118,8 +51642,8 @@ This function is used to asynchronously accept a new connection into a socket, a [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51130,7 +51654,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -51163,9 +51687,9 @@ Start an asynchronous accept. template< - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto async_accept( + MoveAcceptToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously accept a new connection. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51181,13 +51705,13 @@ This overload requires that the Protocol template parameter satisfy the Acceptab [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // Result of operation. + const asio::error_code& error, - // On success, the newly accepted socket. - typename Protocol::socket::template - rebind_executor::other peer - ); + // On success, the newly accepted socket. + typename Protocol::socket::template + rebind_executor::other peer + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51198,9 +51722,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, - typename Protocol::socket::template - rebind_executor::other)) + void(asio::error_code, + typename Protocol::socket::template + rebind_executor::other)) @@ -51210,20 +51734,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error, - asio::ip::tcp::socket peer) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + acceptor.async_accept(accept_handler); @@ -51257,11 +51781,11 @@ Start an asynchronous accept. template< typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto async_accept( const Executor1 & ex, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); This function is used to asynchronously accept a new connection. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51279,13 +51803,13 @@ This overload requires that the Protocol template parameter satisfy the Acceptab [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // Result of operation. + const asio::error_code& error, - // On success, the newly accepted socket. - typename Protocol::socket::template rebind_executor< - Executor1>::other peer - ); + // On success, the newly accepted socket. + typename Protocol::socket::template rebind_executor< + Executor1>::other peer + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51296,9 +51820,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, - typename Protocol::socket::template rebind_executor< - Executor1>::other)) + void(asio::error_code, + typename Protocol::socket::template rebind_executor< + Executor1>::other)) @@ -51308,20 +51832,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error, - asio::ip::tcp::socket peer) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + acceptor.async_accept(my_context2, accept_handler); @@ -51355,11 +51879,11 @@ Start an asynchronous accept. template< typename ExecutionContext, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto async_accept( ExecutionContext & context, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This function is used to asynchronously accept a new connection. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51377,13 +51901,13 @@ This overload requires that the Protocol template parameter satisfy the Acceptab [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // Result of operation. + const asio::error_code& error, - // On success, the newly accepted socket. - typename Protocol::socket::template rebind_executor< - typename ExecutionContext::executor_type>::other peer - ); + // On success, the newly accepted socket. + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51394,9 +51918,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, - typename Protocol::socket::template rebind_executor< - typename ExecutionContext::executor_type>::other)) + void(asio::error_code, + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other)) @@ -51406,20 +51930,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error, - asio::ip::tcp::socket peer) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + acceptor.async_accept(my_context2, accept_handler); @@ -51452,10 +51976,10 @@ Start an asynchronous accept. template< - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto async_accept( endpoint_type & peer_endpoint, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + MoveAcceptToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously accept a new connection. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51473,13 +51997,13 @@ This overload requires that the Protocol template parameter satisfy the Acceptab [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // Result of operation. + const asio::error_code& error, - // On success, the newly accepted socket. - typename Protocol::socket::template - rebind_executor::other peer - ); + // On success, the newly accepted socket. + typename Protocol::socket::template + rebind_executor::other peer + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51490,9 +52014,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, - typename Protocol::socket::template - rebind_executor::other)) + void(asio::error_code, + typename Protocol::socket::template + rebind_executor::other)) @@ -51502,21 +52026,21 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error, - asio::ip::tcp::socket peer) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint; + acceptor.async_accept(endpoint, accept_handler); @@ -51550,12 +52074,12 @@ Start an asynchronous accept. template< typename ``[link asio.reference.Executor1 Executor1]``, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto async_accept( const Executor1 & ex, endpoint_type & peer_endpoint, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value > = 0); This function is used to asynchronously accept a new connection. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51575,13 +52099,13 @@ This overload requires that the Protocol template parameter satisfy the Acceptab [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // Result of operation. + const asio::error_code& error, - // On success, the newly accepted socket. - typename Protocol::socket::template rebind_executor< - Executor1>::other peer - ); + // On success, the newly accepted socket. + typename Protocol::socket::template rebind_executor< + Executor1>::other peer + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51592,9 +52116,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, - typename Protocol::socket::template rebind_executor< - Executor1>::other)) + void(asio::error_code, + typename Protocol::socket::template rebind_executor< + Executor1>::other)) @@ -51604,21 +52128,21 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error, - asio::ip::tcp::socket peer) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint; + acceptor.async_accept(my_context2, endpoint, accept_handler); @@ -51652,12 +52176,12 @@ Start an asynchronous accept. template< typename ExecutionContext, - typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_accept( + typename ``[link asio.reference.MoveAcceptToken MoveAcceptToken]`` = default_completion_token_t> + auto async_accept( ExecutionContext & context, endpoint_type & peer_endpoint, - MoveAcceptToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + MoveAcceptToken && token = default_completion_token_t< executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This function is used to asynchronously accept a new connection. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51677,13 +52201,13 @@ This overload requires that the Protocol template parameter satisfy the Acceptab [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the accept completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - // Result of operation. - const asio::error_code& error, + // Result of operation. + const asio::error_code& error, - // On success, the newly accepted socket. - typename Protocol::socket::template rebind_executor< - typename ExecutionContext::executor_type>::other peer - ); + // On success, the newly accepted socket. + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51694,9 +52218,9 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, - typename Protocol::socket::template rebind_executor< - typename ExecutionContext::executor_type>::other)) + void(asio::error_code, + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other)) @@ -51706,21 +52230,21 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void accept_handler(const asio::error_code& error, - asio::ip::tcp::socket peer) - { - if (!error) - { - // Accept succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint; + acceptor.async_accept(my_context2, endpoint, accept_handler); @@ -51755,10 +52279,10 @@ Asynchronously wait for the acceptor to become ready to read, ready to write, or template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for an acceptor to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -51774,8 +52298,8 @@ This function is used to perform an asynchronous wait for an acceptor to enter a [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -51786,7 +52310,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -51796,21 +52320,21 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + acceptor.async_wait( + asio::ip::tcp::acceptor::wait_read, + wait_handler); @@ -51849,7 +52373,7 @@ Construct an acceptor without opening it. typename ExecutionContext> explicit ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 basic_socket_acceptor]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 more...]]`` @@ -51866,7 +52390,7 @@ Construct an open acceptor. ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 basic_socket_acceptor]``( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 more...]]`` @@ -51885,7 +52409,7 @@ Construct an acceptor opened on the given endpoint. ExecutionContext & context, const endpoint_type & endpoint, bool reuse_addr = true, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload6 more...]]`` @@ -51904,7 +52428,7 @@ Construct a [link asio.reference.basic_socket_acceptor `basic_socket_acceptor`] ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_acceptor, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload8 more...]]`` @@ -51924,7 +52448,7 @@ Move-construct a [link asio.reference.basic_socket_acceptor `basic_socket_accept typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload10 basic_socket_acceptor]``( basic_socket_acceptor< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload10 more...]]`` @@ -51967,7 +52491,7 @@ Construct an acceptor without opening it. typename ExecutionContext> basic_socket_acceptor( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -52042,7 +52566,7 @@ Construct an open acceptor. basic_socket_acceptor( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates an acceptor and automatically opens it. @@ -52119,12 +52643,12 @@ This constructor creates an acceptor and automatically opens it to listen for ne This constructor is equivalent to the following 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(); + 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(); @@ -52148,7 +52672,7 @@ Construct an acceptor opened on the given endpoint. ExecutionContext & context, const endpoint_type & endpoint, bool reuse_addr = true, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint. @@ -52182,12 +52706,12 @@ This constructor creates an acceptor and automatically opens it to listen for ne This constructor is equivalent to the following 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(); + 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(); @@ -52256,7 +52780,7 @@ Construct a [link asio.reference.basic_socket_acceptor `basic_socket_acceptor`] ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_acceptor, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates an acceptor object to hold an existing native acceptor. @@ -52337,7 +52861,7 @@ Move-construct a [link asio.reference.basic_socket_acceptor `basic_socket_accept typename ``[link asio.reference.Executor1 Executor1]``> basic_socket_acceptor( basic_socket_acceptor< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); This constructor moves an acceptor from one object to another. @@ -52418,10 +52942,10 @@ This function binds the socket acceptor to the specified endpoint on the local m - asio::ip::tcp::acceptor acceptor(my_context); - asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); - acceptor.open(endpoint.protocol()); - acceptor.bind(endpoint); + asio::ip::tcp::acceptor acceptor(my_context); + asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); + acceptor.open(endpoint.protocol()); + acceptor.bind(endpoint); @@ -52463,15 +52987,15 @@ This function binds the socket acceptor to the specified endpoint on the local m - 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. - } + 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. + } @@ -52505,10 +53029,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -52516,11 +53040,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -52559,11 +53083,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -52726,14 +53250,14 @@ A subsequent call to `open()` is required before the acceptor can again be used - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::error_code ec; - acceptor.close(ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::error_code ec; + acceptor.close(ec); + if (ec) + { + // An error occurred. + } @@ -52767,10 +53291,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -52778,11 +53302,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -52821,10 +53345,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -52832,11 +53356,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -52875,10 +53399,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -52886,11 +53410,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -53024,11 +53548,11 @@ This function is used to get the current value of an option on the acceptor. 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::acceptor::reuse_address option; + acceptor.get_option(option); + bool is_set = option.get(); @@ -53073,16 +53597,16 @@ This function is used to get the current value of an option on the acceptor. 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(); + 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(); @@ -53155,10 +53679,10 @@ This function is used to execute an IO control command on the acceptor. 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::acceptor::non_blocking_io command(true); + socket.io_control(command); @@ -53203,15 +53727,15 @@ This function is used to execute an IO control command on the acceptor. 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. - } + 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. + } @@ -53259,10 +53783,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -53270,11 +53794,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -53313,10 +53837,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -53324,12 +53848,12 @@ Setting the 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(); + 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(); @@ -53432,14 +53956,14 @@ This function puts the socket acceptor into the state where it may accept new co - 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. - } + 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. + } @@ -53497,9 +54021,9 @@ An object that represents the local endpoint of the acceptor. - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); @@ -53543,14 +54067,14 @@ An object that represents the local endpoint of the acceptor. Returns a default- - 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. - } + 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. + } @@ -54029,8 +54553,8 @@ This function opens the socket acceptor so that it will use the specified protoc - asio::ip::tcp::acceptor acceptor(my_context); - acceptor.open(asio::ip::tcp::v4()); + asio::ip::tcp::acceptor acceptor(my_context); + acceptor.open(asio::ip::tcp::v4()); @@ -54072,13 +54596,13 @@ This function opens the socket acceptor so that it will use the specified protoc - asio::ip::tcp::acceptor acceptor(my_context); - asio::error_code ec; - acceptor.open(asio::ip::tcp::v4(), ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::acceptor acceptor(my_context); + asio::error_code ec; + acceptor.open(asio::ip::tcp::v4(), ec); + if (ec) + { + // An error occurred. + } @@ -54108,7 +54632,7 @@ Move-assign a [link asio.reference.basic_socket_acceptor `basic_socket_acceptor` template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket_acceptor & >::type ``[link asio.reference.basic_socket_acceptor.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket_acceptor & > ``[link asio.reference.basic_socket_acceptor.operator_eq_.overload2 operator=]``( basic_socket_acceptor< Protocol1, Executor1 > && other); `` [''''»''' [link asio.reference.basic_socket_acceptor.operator_eq_.overload2 more...]]`` @@ -54156,7 +54680,7 @@ Move-assign a [link asio.reference.basic_socket_acceptor `basic_socket_acceptor` template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket_acceptor & >::type operator=( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket_acceptor & > operator=( basic_socket_acceptor< Protocol1, Executor1 > && other); @@ -54206,10 +54730,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -54217,11 +54741,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -54281,10 +54805,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -54292,11 +54816,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -54335,10 +54859,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -54346,11 +54870,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -54471,10 +54995,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -54482,11 +55006,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -54525,10 +55049,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -54536,11 +55060,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -54579,10 +55103,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -54590,11 +55114,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -54672,10 +55196,10 @@ This function is used to set an option on the acceptor. 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::ip::tcp::acceptor::reuse_address option(true); + acceptor.set_option(option); @@ -54720,15 +55244,15 @@ This function is used to set an option on the acceptor. 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. - } + 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. + } @@ -54824,9 +55348,9 @@ This function is used to perform a blocking wait for an acceptor to enter a read Waiting for an acceptor to become readable. - asio::ip::tcp::acceptor acceptor(my_context); - ... - acceptor.wait(asio::ip::tcp::acceptor::wait_read); + asio::ip::tcp::acceptor acceptor(my_context); + ... + acceptor.wait(asio::ip::tcp::acceptor::wait_read); @@ -54868,10 +55392,10 @@ This function is used to perform a blocking wait for an acceptor to enter a read 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); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::error_code ec; + acceptor.wait(asio::ip::tcp::acceptor::wait_read, ec); @@ -55331,12 +55855,12 @@ Synchronous `accept` operations are thread safe, if the underlying operating sys 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(); + 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(); @@ -55369,7 +55893,8 @@ Iostream interface for a socket. typename ``[link asio.reference.Protocol Protocol]``, typename Clock = chrono::steady_clock, typename ``[link asio.reference.WaitTraits WaitTraits]`` = wait_traits> - class basic_socket_iostream + class basic_socket_iostream : + public std::basic_iostream< char > [heading Types] @@ -55534,13 +56059,9 @@ Establish a connection to an endpoint corresponding to a resolver query. template< - typename T1, - ... , - typename TN> + typename... T> explicit ``[link asio.reference.basic_socket_iostream.basic_socket_iostream.overload4 basic_socket_iostream]``( - T1 t1, - ... , - TN tn); + T... x); `` [''''»''' [link asio.reference.basic_socket_iostream.basic_socket_iostream.overload4 more...]]`` @@ -55595,13 +56116,9 @@ Establish a connection to an endpoint corresponding to a resolver query. template< - typename T1, - ... , - typename TN> + typename... T> basic_socket_iostream( - T1 t1, - ... , - TN tn); + T... x); This constructor automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object. @@ -55655,13 +56172,9 @@ Establish a connection to an endpoint corresponding to a resolver query. template< - typename T1, - ... , - typename TN> + typename... T> void connect( - T1 t1, - ... , - TN tn); + T... x); This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object. @@ -55754,10 +56267,10 @@ An `error_code` corresponding to the last error from the stream. 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; - } + if (!s) + { + std::cout << "Error: " << s.error().message() << std::endl; + } @@ -56078,6 +56591,7 @@ Iostream streambuf for a socket. typename Clock = chrono::steady_clock, typename ``[link asio.reference.WaitTraits WaitTraits]`` = wait_traits> class basic_socket_streambuf : + public std::streambuf, basic_socket< Protocol > @@ -56366,13 +56880,9 @@ Establish a connection. `` [''''»''' [link asio.reference.basic_socket_streambuf.connect.overload1 more...]]`` template< - typename T1, - ... , - typename TN> + typename... T> basic_socket_streambuf * ``[link asio.reference.basic_socket_streambuf.connect.overload2 connect]``( - T1 t1, - ... , - TN tn); + T... x); `` [''''»''' [link asio.reference.basic_socket_streambuf.connect.overload2 more...]]`` @@ -56407,13 +56917,9 @@ Establish a connection. template< - typename T1, - ... , - typename TN> + typename... T> basic_socket_streambuf * connect( - T1 t1, - ... , - TN tn); + T... x); This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object. @@ -56756,7 +57262,7 @@ The protocol type. [section:puberror basic_socket_streambuf::puberror] [indexterm2 asio.indexterm.basic_socket_streambuf.puberror..puberror..basic_socket_streambuf] -(Deprecated: Use `error()`.) Get the last error associated with the stream buffer. +(Deprecated: Use error().) Get the last error associated with the stream buffer. const asio::error_code & puberror() const; @@ -57199,10 +57705,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the stream file. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -57218,9 +57724,9 @@ This function is used to asynchronously read data from the stream file. It is an [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -57231,7 +57737,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -57246,7 +57752,7 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - file.async_read_some(asio::buffer(data, size), handler); + file.async_read_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -57280,10 +57786,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the stream file. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -57299,9 +57805,9 @@ This function is used to asynchronously write data to the stream file. It is an [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -57312,7 +57818,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -57327,7 +57833,7 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - file.async_write_some(asio::buffer(data, size), handler); + file.async_write_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -57366,7 +57872,7 @@ Construct a [link asio.reference.basic_stream_file `basic_stream_file`] without typename ExecutionContext> explicit ``[link asio.reference.basic_stream_file.basic_stream_file.overload2 basic_stream_file]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_stream_file.basic_stream_file.overload2 more...]]`` @@ -57385,7 +57891,7 @@ Construct and open a [link asio.reference.basic_stream_file `basic_stream_file`] ExecutionContext & context, const char * path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_stream_file.basic_stream_file.overload4 more...]]`` ``[link asio.reference.basic_stream_file.basic_stream_file.overload5 basic_stream_file]``( @@ -57400,7 +57906,7 @@ Construct and open a [link asio.reference.basic_stream_file `basic_stream_file`] ExecutionContext & context, const std::string & path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_stream_file.basic_stream_file.overload6 more...]]`` @@ -57417,7 +57923,7 @@ Construct a [link asio.reference.basic_stream_file `basic_stream_file`] on an ex ``[link asio.reference.basic_stream_file.basic_stream_file.overload8 basic_stream_file]``( ExecutionContext & context, const native_handle_type & native_file, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_stream_file.basic_stream_file.overload8 more...]]`` @@ -57436,7 +57942,7 @@ Move-construct a [link asio.reference.basic_stream_file `basic_stream_file`] fro typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_stream_file.basic_stream_file.overload10 basic_stream_file]``( basic_stream_file< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_stream_file.basic_stream_file.overload10 more...]]`` @@ -57479,7 +57985,7 @@ Construct a [link asio.reference.basic_stream_file `basic_stream_file`] without typename ExecutionContext> basic_stream_file( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a file without opening it. The file needs to be opened before data can be read from or or written to it. @@ -57558,7 +58064,7 @@ Construct and open a [link asio.reference.basic_stream_file `basic_stream_file`] ExecutionContext & context, const char * path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises and opens a file. @@ -57651,7 +58157,7 @@ Construct and open a [link asio.reference.basic_stream_file `basic_stream_file`] ExecutionContext & context, const std::string & path, file_base::flags open_flags, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises and opens a file. @@ -57740,7 +58246,7 @@ Construct a [link asio.reference.basic_stream_file `basic_stream_file`] on an ex basic_stream_file( ExecutionContext & context, const native_handle_type & native_file, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor initialises a stream file object to hold an existing native file. @@ -57818,7 +58324,7 @@ Move-construct a [link asio.reference.basic_stream_file `basic_stream_file`] fro typename ``[link asio.reference.Executor1 Executor1]``> basic_stream_file( basic_stream_file< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a stream file from one object to another. @@ -58025,14 +58531,14 @@ This function is used to close the file. Any asynchronous read or write operatio - asio::stream_file file(my_context); - ... - asio::error_code ec; - file.close(ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + ... + asio::error_code ec; + file.close(ec); + if (ec) + { + // An error occurred. + } @@ -58270,8 +58776,8 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - file.open("/path/to/my/file", asio::stream_file::read_only); + asio::stream_file file(my_context); + file.open("/path/to/my/file", asio::stream_file::read_only); @@ -58319,13 +58825,13 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - asio::error_code ec; - file.open("/path/to/my/file", asio::stream_file::read_only, ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + asio::error_code ec; + file.open("/path/to/my/file", asio::stream_file::read_only, ec); + if (ec) + { + // An error occurred. + } @@ -58380,8 +58886,8 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - file.open("/path/to/my/file", asio::stream_file::read_only); + asio::stream_file file(my_context); + file.open("/path/to/my/file", asio::stream_file::read_only); @@ -58429,13 +58935,13 @@ This function opens the file so that it will use the specified path. - asio::stream_file file(my_context); - asio::error_code ec; - file.open("/path/to/my/file", asio::stream_file::read_only, ec); - if (ec) - { - // An error occurred. - } + asio::stream_file file(my_context); + asio::error_code ec; + file.open("/path/to/my/file", asio::stream_file::read_only, ec); + if (ec) + { + // An error occurred. + } @@ -58464,7 +58970,7 @@ Move-assign a [link asio.reference.basic_stream_file `basic_stream_file`] from a template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_stream_file & >::type ``[link asio.reference.basic_stream_file.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_stream_file & > ``[link asio.reference.basic_stream_file.operator_eq_.overload2 operator=]``( basic_stream_file< Executor1 > && other); `` [''''»''' [link asio.reference.basic_stream_file.operator_eq_.overload2 more...]]`` @@ -58511,7 +59017,7 @@ Move-assign a [link asio.reference.basic_stream_file `basic_stream_file`] from a template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_stream_file & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_stream_file & > operator=( basic_stream_file< Executor1 > && other); @@ -58626,7 +59132,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - file.read_some(asio::buffer(data, size)); + file.read_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -59382,7 +59888,7 @@ The write\_some operation may not transmit all of the data to the peer. Consider To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - file.write_some(asio::buffer(data, size)); + file.write_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -60230,10 +60736,10 @@ Start an asynchronous connect. template< - typename ``[link asio.reference.ConnectToken ConnectToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_connect( + typename ``[link asio.reference.ConnectToken ConnectToken]`` = default_completion_token_t> + auto async_connect( const endpoint_type & peer_endpoint, - ConnectToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ConnectToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously connect a socket to the specified remote endpoint. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60251,8 +60757,8 @@ The socket is automatically opened if it is not already open. If the connect fai [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the connect completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -60263,7 +60769,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -60273,20 +60779,20 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void connect_handler(const asio::error_code& error) - { - if (!error) - { - // Connect succeeded. - } - } + 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); + 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); @@ -60320,10 +60826,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the stream socket. socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60339,9 +60845,9 @@ This function is used to asynchronously read data from the stream socket. socket [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -60352,7 +60858,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -60367,7 +60873,7 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_read_some(asio::buffer(data, size), handler); + socket.async_read_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -60400,19 +60906,19 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_stream_socket.async_receive.overload1 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_stream_socket.async_receive.overload1 async_receive]``( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_stream_socket.async_receive.overload1 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_stream_socket.async_receive.overload2 async_receive]``( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_stream_socket.async_receive.overload2 async_receive]``( const MutableBufferSequence & buffers, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_stream_socket.async_receive.overload2 more...]]`` @@ -60424,10 +60930,10 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the stream socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60443,9 +60949,9 @@ This function is used to asynchronously receive data from the stream socket. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -60456,7 +60962,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -60471,7 +60977,7 @@ The receive operation may not receive all of the requested number of bytes. Cons To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive(asio::buffer(data, size), handler); + socket.async_receive(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -60505,11 +61011,11 @@ Start an asynchronous receive. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_receive( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_receive( const MutableBufferSequence & buffers, socket_base::message_flags flags, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously receive data from the stream socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60527,9 +61033,9 @@ This function is used to asynchronously receive data from the stream socket. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the receive completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes received. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -60540,7 +61046,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -60555,7 +61061,7 @@ The receive operation may not receive all of the requested number of bytes. Cons To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_receive(asio::buffer(data, size), 0, handler); + socket.async_receive(asio::buffer(data, size), 0, handler); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -60590,19 +61096,19 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_stream_socket.async_send.overload1 async_send]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_stream_socket.async_send.overload1 async_send]``( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_stream_socket.async_send.overload1 more...]]`` template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.basic_stream_socket.async_send.overload2 async_send]``( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto ``[link asio.reference.basic_stream_socket.async_send.overload2 async_send]``( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.basic_stream_socket.async_send.overload2 more...]]`` @@ -60614,10 +61120,10 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the stream socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60633,9 +61139,9 @@ This function is used to asynchronously send data on the stream socket. It is an [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -60646,7 +61152,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -60661,7 +61167,7 @@ The send operation may not transmit all of the data to the peer. Consider using To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_send(asio::buffer(data, size), handler); + socket.async_send(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -60695,11 +61201,11 @@ Start an asynchronous send. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_send( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_send( const ConstBufferSequence & buffers, socket_base::message_flags flags, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously send data on the stream socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60717,9 +61223,9 @@ This function is used to asynchronously send data on the stream socket. It is an [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the send completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes sent. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -60730,7 +61236,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -60745,7 +61251,7 @@ The send operation may not transmit all of the data to the peer. Consider using To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_send(asio::buffer(data, size), 0, handler); + socket.async_send(asio::buffer(data, size), 0, handler); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -60783,10 +61289,10 @@ Asynchronously wait for the socket to become ready to read, ready to write, or t template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60802,8 +61308,8 @@ This function is used to perform an asynchronous wait for a socket to enter a re [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -60814,7 +61320,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -60824,19 +61330,19 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::ip::tcp::socket socket(my_context); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -60870,10 +61376,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the stream socket. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -60889,9 +61395,9 @@ This function is used to asynchronously write data to the stream socket. It is a [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -60902,7 +61408,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -60917,7 +61423,7 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.async_write_some(asio::buffer(data, size), handler); + socket.async_write_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -61132,7 +61638,7 @@ Construct a [link asio.reference.basic_stream_socket `basic_stream_socket`] with typename ExecutionContext> explicit ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload2 more...]]`` @@ -61149,7 +61655,7 @@ Construct and open a [link asio.reference.basic_stream_socket `basic_stream_sock ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload4 basic_stream_socket]``( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload4 more...]]`` @@ -61166,7 +61672,7 @@ Construct a [link asio.reference.basic_stream_socket `basic_stream_socket`], ope ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload6 basic_stream_socket]``( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload6 more...]]`` @@ -61185,7 +61691,7 @@ Construct a [link asio.reference.basic_stream_socket `basic_stream_socket`] on a ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload8 more...]]`` @@ -61205,7 +61711,7 @@ Move-construct a [link asio.reference.basic_stream_socket `basic_stream_socket`] typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload10 basic_stream_socket]``( basic_stream_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload10 more...]]`` @@ -61248,7 +61754,7 @@ Construct a [link asio.reference.basic_stream_socket `basic_stream_socket`] with typename ExecutionContext> basic_stream_socket( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -61323,7 +61829,7 @@ Construct and open a [link asio.reference.basic_stream_socket `basic_stream_sock basic_stream_socket( ExecutionContext & context, const protocol_type & protocol, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); 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. @@ -61410,7 +61916,7 @@ Construct a [link asio.reference.basic_stream_socket `basic_stream_socket`], ope basic_stream_socket( ExecutionContext & context, const endpoint_type & endpoint, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -61501,7 +62007,7 @@ Construct a [link asio.reference.basic_stream_socket `basic_stream_socket`] on a ExecutionContext & context, const protocol_type & protocol, const native_handle_type & native_socket, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a stream socket object to hold an existing native socket. @@ -61582,7 +62088,7 @@ Move-construct a [link asio.reference.basic_stream_socket `basic_stream_socket`] typename ``[link asio.reference.Executor1 Executor1]``> basic_stream_socket( basic_stream_socket< Protocol1, Executor1 > && other, - typename constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value > = 0); This constructor moves a stream socket from one object to another. @@ -61666,10 +62172,10 @@ This function binds the socket to the specified endpoint on the local machine. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); - socket.bind(asio::ip::tcp::endpoint( - asio::ip::tcp::v4(), 12345)); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); + socket.bind(asio::ip::tcp::endpoint( + asio::ip::tcp::v4(), 12345)); @@ -61714,15 +62220,15 @@ This function binds the socket to the specified endpoint on the local machine. - 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. - } + 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. + } @@ -61756,10 +62262,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -61767,11 +62273,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -61810,11 +62316,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -62028,14 +62534,14 @@ This function is used to close the socket. Any asynchronous send, receive or con - asio::ip::tcp::socket socket(my_context); - ... - asio::error_code ec; - socket.close(ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.close(ec); + if (ec) + { + // An error occurred. + } @@ -62111,10 +62617,10 @@ The socket is automatically opened if it is not already open. If the connect fai - 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); + 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); @@ -62161,15 +62667,15 @@ The socket is automatically opened if it is not already open. If the connect fai - 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. - } + 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. + } @@ -62203,10 +62709,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -62214,11 +62720,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -62257,10 +62763,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -62268,11 +62774,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -62311,10 +62817,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -62322,11 +62828,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -62466,11 +62972,11 @@ This function is used to get the current value of an option on the socket. 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::socket::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -62518,16 +63024,16 @@ This function is used to get the current value of an option on the socket. 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(); + 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(); @@ -62603,11 +63109,11 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -62655,16 +63161,16 @@ This function is used to execute an IO control command on the socket. 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(); + 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(); @@ -62715,10 +63221,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -62726,11 +63232,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -62769,10 +63275,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -62780,12 +63286,12 @@ Setting the 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(); + 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(); @@ -62851,9 +63357,9 @@ An object that represents the local endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -62900,14 +63406,14 @@ An object that represents the local endpoint of the socket. Returns a default-co - 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. - } + 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. + } @@ -63605,69 +64111,69 @@ The current non-blocking mode is cached by the socket object. Consequently, the 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -63720,69 +64226,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -63828,69 +64334,69 @@ This function is used to modify the non-blocking mode of the underlying native s 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 - 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_); - } - }; + 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); - 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); - } + 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); + } @@ -64095,8 +64601,8 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - socket.open(asio::ip::tcp::v4()); + asio::ip::tcp::socket socket(my_context); + socket.open(asio::ip::tcp::v4()); @@ -64141,13 +64647,13 @@ This function opens the socket so that it will use the specified protocol. - asio::ip::tcp::socket socket(my_context); - asio::error_code ec; - socket.open(asio::ip::tcp::v4(), ec); - if (ec) - { - // An error occurred. - } + asio::ip::tcp::socket socket(my_context); + asio::error_code ec; + socket.open(asio::ip::tcp::v4(), ec); + if (ec) + { + // An error occurred. + } @@ -64177,7 +64683,7 @@ Move-assign a [link asio.reference.basic_stream_socket `basic_stream_socket`] fr template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_stream_socket & >::type ``[link asio.reference.basic_stream_socket.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_stream_socket & > ``[link asio.reference.basic_stream_socket.operator_eq_.overload2 operator=]``( basic_stream_socket< Protocol1, Executor1 > && other); `` [''''»''' [link asio.reference.basic_stream_socket.operator_eq_.overload2 more...]]`` @@ -64225,7 +64731,7 @@ Move-assign a [link asio.reference.basic_stream_socket `basic_stream_socket`] fr template< typename ``[link asio.reference.Protocol Protocol1]``, typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_stream_socket & >::type operator=( + constraint_t< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_stream_socket & > operator=( basic_stream_socket< Protocol1, Executor1 > && other); @@ -64275,10 +64781,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -64286,11 +64792,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -64398,7 +64904,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.read_some(asio::buffer(data, size)); + socket.read_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -64536,7 +65042,7 @@ The receive operation may not receive all of the requested number of bytes. Cons To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.receive(asio::buffer(data, size)); + socket.receive(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -64600,7 +65106,7 @@ The receive operation may not receive all of the requested number of bytes. Cons To receive into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.receive(asio::buffer(data, size), 0); + socket.receive(asio::buffer(data, size), 0); See the [link asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -64681,10 +65187,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -64692,11 +65198,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -64735,10 +65241,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -64746,11 +65252,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -64904,9 +65410,9 @@ An object that represents the remote endpoint of the socket. - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -64953,14 +65459,14 @@ An object that represents the remote endpoint of the socket. Returns a default-c - 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. - } + 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. + } @@ -64994,10 +65500,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -65005,11 +65511,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -65104,7 +65610,7 @@ The send operation may not transmit all of the data to the peer. Consider using To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.send(asio::buffer(data, size)); + socket.send(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -65168,7 +65674,7 @@ The send operation may not transmit all of the data to the peer. Consider using To send a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.send(asio::buffer(data, size), 0); + socket.send(asio::buffer(data, size), 0); See the [link asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -65249,10 +65755,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -65260,11 +65766,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -65303,10 +65809,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -65314,11 +65820,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -65399,10 +65905,10 @@ This function is used to set an option on the socket. 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option(true); + socket.set_option(option); @@ -65450,15 +65956,15 @@ This function is used to set an option on the socket. 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. - } + 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. + } @@ -65527,9 +66033,9 @@ This function is used to disable send operations, receive operations, or both. Shutting down the send side of the socket: - asio::ip::tcp::socket socket(my_context); - ... - socket.shutdown(asio::ip::tcp::socket::shutdown_send); + asio::ip::tcp::socket socket(my_context); + ... + socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -65574,14 +66080,14 @@ This function is used to disable send operations, receive operations, or both. 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. - } + 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. + } @@ -65680,9 +66186,9 @@ This function is used to perform a blocking wait for a socket to enter a ready t Waiting for a socket to become readable. - asio::ip::tcp::socket socket(my_context); - ... - socket.wait(asio::ip::tcp::socket::wait_read); + asio::ip::tcp::socket socket(my_context); + ... + socket.wait(asio::ip::tcp::socket::wait_read); @@ -65727,10 +66233,10 @@ This function is used to perform a blocking wait for a socket to enter a ready t 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); + asio::ip::tcp::socket socket(my_context); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -65854,7 +66360,7 @@ The write\_some operation may not transmit all of the data to the peer. Consider To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - socket.write_some(asio::buffer(data, size)); + socket.write_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -66408,6 +66914,7 @@ Automatically resizable buffer class based on std::streambuf. template< typename Allocator = std::allocator> class basic_streambuf : + public std::streambuf, noncopyable @@ -66513,7 +67020,7 @@ The `basic_streambuf` class's public interface is intended to permit the followi The constructor for [link asio.reference.basic_streambuf `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() + 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`. @@ -66525,33 +67032,33 @@ The constructor for `basic_streambuf` takes an Allocator argument. A copy of thi Writing directly from an streambuf to a socket: - asio::streambuf b; - std::ostream os(&b); - os << "Hello, World!\n"; + 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()); + // try sending some data in input sequence + size_t n = sock.send(b.data()); - b.consume(n); // sent data is removed from input sequence + b.consume(n); // sent data is removed from input sequence Reading from a socket directly into a streambuf: - asio::streambuf b; + asio::streambuf b; - // reserve 512 bytes in output sequence - asio::streambuf::mutable_buffers_type bufs = b.prepare(512); + // reserve 512 bytes in output sequence + asio::streambuf::mutable_buffers_type bufs = b.prepare(512); - size_t n = sock.receive(bufs); + size_t n = sock.receive(bufs); - // received data is "committed" from output sequence to input sequence - b.commit(n); + // received data is "committed" from output sequence to input sequence + b.commit(n); - std::istream is(&b); - std::string s; - is >> s; + std::istream is(&b); + std::string s; + is >> s; @@ -66824,14 +67331,14 @@ Get the size of the input sequence. 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(); - } + 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(); + } @@ -67164,7 +67671,7 @@ The `basic_streambuf` class's public interface is intended to permit the followi The constructor for [link asio.reference.basic_streambuf `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() + 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`. @@ -67176,33 +67683,33 @@ The constructor for `basic_streambuf` takes an Allocator argument. A copy of thi Writing directly from an streambuf to a socket: - asio::streambuf b; - std::ostream os(&b); - os << "Hello, World!\n"; + 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()); + // try sending some data in input sequence + size_t n = sock.send(b.data()); - b.consume(n); // sent data is removed from input sequence + b.consume(n); // sent data is removed from input sequence Reading from a socket directly into a streambuf: - asio::streambuf b; + asio::streambuf b; - // reserve 512 bytes in output sequence - asio::streambuf::mutable_buffers_type bufs = b.prepare(512); + // reserve 512 bytes in output sequence + asio::streambuf::mutable_buffers_type bufs = b.prepare(512); - size_t n = sock.receive(bufs); + size_t n = sock.receive(bufs); - // received data is "committed" from output sequence to input sequence - b.commit(n); + // received data is "committed" from output sequence to input sequence + b.commit(n); - std::istream is(&b); - std::string s; - is >> s; + std::istream is(&b); + std::string s; + is >> s; @@ -67373,7 +67880,7 @@ The `basic_streambuf` class's public interface is intended to permit the followi The constructor for [link asio.reference.basic_streambuf `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() + 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`. @@ -67385,33 +67892,33 @@ The constructor for `basic_streambuf` takes an Allocator argument. A copy of thi Writing directly from an streambuf to a socket: - asio::streambuf b; - std::ostream os(&b); - os << "Hello, World!\n"; + 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()); + // try sending some data in input sequence + size_t n = sock.send(b.data()); - b.consume(n); // sent data is removed from input sequence + b.consume(n); // sent data is removed from input sequence Reading from a socket directly into a streambuf: - asio::streambuf b; + asio::streambuf b; - // reserve 512 bytes in output sequence - asio::streambuf::mutable_buffers_type bufs = b.prepare(512); + // reserve 512 bytes in output sequence + asio::streambuf::mutable_buffers_type bufs = b.prepare(512); - size_t n = sock.receive(bufs); + size_t n = sock.receive(bufs); - // received data is "committed" from output sequence to input sequence - b.commit(n); + // received data is "committed" from output sequence to input sequence + b.commit(n); - std::istream is(&b); - std::string s; - is >> s; + std::istream is(&b); + std::string s; + is >> s; @@ -67630,9 +68137,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -67669,9 +68176,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -67741,7 +68248,7 @@ For the system executor, this is a no-op. Compare two executors for inequality. - friend bool operator!=( + bool operator!=( const basic_system_executor & , const basic_system_executor & ); @@ -67765,7 +68272,7 @@ Two executors are equal if they refer to the same underlying [link asio.referenc Compare two executors for equality. - friend bool operator==( + bool operator==( const basic_system_executor & , const basic_system_executor & ); @@ -67805,9 +68312,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -67863,8 +68370,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - auto alloc = asio::query(ex, - asio::execution::allocator); + auto alloc = asio::query(ex, + asio::execution::allocator); @@ -67889,8 +68396,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - auto alloc = asio::query(ex, - asio::execution::allocator); + auto alloc = asio::query(ex, + asio::execution::allocator); @@ -67915,8 +68422,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - std::size_t occupancy = asio::query( - ex, asio::execution::occupancy); + std::size_t occupancy = asio::query( + ex, asio::execution::occupancy); @@ -67977,9 +68484,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - if (asio::query(ex, asio::execution::mapping) - == asio::execution::mapping.thread) - ... + if (asio::query(ex, asio::execution::mapping) + == asio::execution::mapping.thread) + ... @@ -68004,8 +68511,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - asio::system_context& pool = asio::query( - ex, asio::execution::context); + asio::system_context& pool = asio::query( + ex, asio::execution::context); @@ -68030,9 +68537,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - if (asio::query(ex, asio::execution::blocking) - == asio::execution::blocking.always) - ... + if (asio::query(ex, asio::execution::blocking) + == asio::execution::blocking.always) + ... @@ -68057,9 +68564,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex; - if (asio::query(ex, asio::execution::relationship) - == asio::execution::relationship.continuation) - ... + if (asio::query(ex, asio::execution::relationship) + == asio::execution::relationship.continuation) + ... @@ -68146,8 +68653,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::blocking.possibly); + auto ex2 = asio::require(ex1, + asio::execution::blocking.possibly); @@ -68172,8 +68679,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::blocking.always); + auto ex2 = asio::require(ex1, + asio::execution::blocking.always); @@ -68198,8 +68705,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::blocking.never); + auto ex2 = asio::require(ex1, + asio::execution::blocking.never); @@ -68224,8 +68731,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::relationship.continuation); + auto ex2 = asio::require(ex1, + asio::execution::relationship.continuation); @@ -68250,8 +68757,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::relationship.fork); + auto ex2 = asio::require(ex1, + asio::execution::relationship.fork); @@ -68278,8 +68785,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::allocator(my_allocator)); + auto ex2 = asio::require(ex1, + asio::execution::allocator(my_allocator)); @@ -68304,8 +68811,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::system_executor ex1; - auto ex2 = asio::require(ex1, - asio::execution::allocator); + auto ex2 = asio::require(ex1, + asio::execution::allocator); @@ -68487,14 +68994,14 @@ This waitable timer functionality is for use with the C++11 standard library's ` Performing a blocking wait (C++11): - // Construct a timer without setting an expiry time. - asio::steady_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_after(std::chrono::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -68502,22 +69009,22 @@ Performing a blocking wait (C++11): Performing an asynchronous wait (C++11): - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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)); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -68531,26 +69038,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -68577,9 +69084,9 @@ Start an asynchronous wait on the timer. template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( + WaitToken && token = default_completion_token_t< executor_type >()); This function may be used to initiate an asynchronous wait against the timer. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -68601,8 +69108,8 @@ For each call to `async_wait()`, the completion handler will be called exactly o [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the timer expires. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -68613,7 +69120,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -68652,7 +69159,7 @@ Constructor. typename ExecutionContext> explicit ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload2 basic_waitable_timer]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload2 more...]]`` @@ -68669,7 +69176,7 @@ Constructor to set a particular expiry time as an absolute time. explicit ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload4 basic_waitable_timer]``( ExecutionContext & context, const time_point & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload4 more...]]`` @@ -68686,7 +69193,7 @@ Constructor to set a particular expiry time relative to now. explicit ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload6 basic_waitable_timer]``( ExecutionContext & context, const duration & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload6 more...]]`` @@ -68701,7 +69208,7 @@ Move-construct a [link asio.reference.basic_waitable_timer `basic_waitable_timer typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload8 basic_waitable_timer]``( basic_waitable_timer< Clock, WaitTraits, Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload8 more...]]`` @@ -68744,7 +69251,7 @@ Constructor. typename ExecutionContext> basic_waitable_timer( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 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. @@ -68809,7 +69316,7 @@ Constructor to set a particular expiry time as an absolute time. basic_waitable_timer( ExecutionContext & context, const time_point & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a timer and sets the expiry time. @@ -68876,7 +69383,7 @@ Constructor to set a particular expiry time relative to now. basic_waitable_timer( ExecutionContext & context, const duration & expiry_time, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a timer and sets the expiry time. @@ -68944,7 +69451,7 @@ Move-construct a [link asio.reference.basic_waitable_timer `basic_waitable_timer typename ``[link asio.reference.Executor1 Executor1]``> basic_waitable_timer( basic_waitable_timer< Clock, WaitTraits, Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Executor1, Executor >::value > = 0); This constructor moves a timer from one object to another. @@ -69646,7 +70153,7 @@ Move-assign a [link asio.reference.basic_waitable_timer `basic_waitable_timer`] template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_waitable_timer & >::type ``[link asio.reference.basic_waitable_timer.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_waitable_timer & > ``[link asio.reference.basic_waitable_timer.operator_eq_.overload2 operator=]``( basic_waitable_timer< Clock, WaitTraits, Executor1 > && other); `` [''''»''' [link asio.reference.basic_waitable_timer.operator_eq_.overload2 more...]]`` @@ -69693,7 +70200,7 @@ Move-assign a [link asio.reference.basic_waitable_timer `basic_waitable_timer`] template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_waitable_timer & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_waitable_timer & > operator=( basic_waitable_timer< Clock, WaitTraits, Executor1 > && other); @@ -70050,14 +70557,14 @@ This waitable timer functionality is for use with the C++11 standard library's ` Performing a blocking wait (C++11): - // Construct a timer without setting an expiry time. - asio::steady_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_after(std::chrono::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -70065,22 +70572,22 @@ Performing a blocking wait (C++11): Performing an asynchronous wait (C++11): - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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)); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -70094,26 +70601,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -70342,10 +70849,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the pipe. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -70361,9 +70868,9 @@ This function is used to asynchronously write data to the pipe. It is an initiat [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -70374,7 +70881,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -70389,7 +70896,7 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - pipe.async_write_some(asio::buffer(data, size), handler); + pipe.async_write_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -70414,7 +70921,7 @@ Construct a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] with typename ExecutionContext> explicit ``[link asio.reference.basic_writable_pipe.basic_writable_pipe.overload2 basic_writable_pipe]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_writable_pipe.basic_writable_pipe.overload2 more...]]`` @@ -70431,7 +70938,7 @@ Construct a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] on a ``[link asio.reference.basic_writable_pipe.basic_writable_pipe.overload4 basic_writable_pipe]``( ExecutionContext & context, const native_handle_type & native_pipe, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.basic_writable_pipe.basic_writable_pipe.overload4 more...]]`` @@ -70450,7 +70957,7 @@ Move-construct a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.basic_writable_pipe.basic_writable_pipe.overload6 basic_writable_pipe]``( basic_writable_pipe< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.basic_writable_pipe.basic_writable_pipe.overload6 more...]]`` @@ -70493,7 +71000,7 @@ Construct a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] with typename ExecutionContext> basic_writable_pipe( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a pipe without opening it. @@ -70568,7 +71075,7 @@ Construct a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] on a basic_writable_pipe( ExecutionContext & context, const native_handle_type & native_pipe, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a pipe object to hold an existing native pipe. @@ -70646,7 +71153,7 @@ Move-construct a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] typename ``[link asio.reference.Executor1 Executor1]``> basic_writable_pipe( basic_writable_pipe< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a pipe from one object to another. @@ -71131,7 +71638,7 @@ Move-assign a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] fr template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_writable_pipe & >::type ``[link asio.reference.basic_writable_pipe.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_writable_pipe & > ``[link asio.reference.basic_writable_pipe.operator_eq_.overload2 operator=]``( basic_writable_pipe< Executor1 > && other); `` [''''»''' [link asio.reference.basic_writable_pipe.operator_eq_.overload2 more...]]`` @@ -71178,7 +71685,7 @@ Move-assign a [link asio.reference.basic_writable_pipe `basic_writable_pipe`] fr template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_writable_pipe & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_writable_pipe & > operator=( basic_writable_pipe< Executor1 > && other); @@ -71358,7 +71865,7 @@ The write\_some operation may not transmit all of the data to the peer. Consider To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - pipe.write_some(asio::buffer(data, size)); + pipe.write_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -71702,12 +72209,12 @@ The [link asio.reference.basic_yield_context `basic_yield_context`] class is a c template - void my_coroutine(basic_yield_context yield) - { - ... - std::size_t n = my_socket.async_read_some(buffer, yield); - ... - } + void my_coroutine(basic_yield_context yield) + { + ... + std::size_t n = my_socket.async_read_some(buffer, yield); + ... + } @@ -71731,7 +72238,7 @@ Construct a yield context from another yield context type. typename ``[link asio.reference.Executor1 OtherExecutor]``> basic_yield_context( const basic_yield_context< OtherExecutor > & other, - typename constraint< is_convertible< OtherExecutor, Executor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, Executor >::value > = 0); Requires that OtherExecutor be convertible to Executor. @@ -71894,28 +72401,28 @@ Get the executor associated with the yield context. [section:operator_lb__rb_ basic_yield_context::operator\[\]] [indexterm2 asio.indexterm.basic_yield_context.operator_lb__rb_..operator\[\]..basic_yield_context] -Return a yield context that sets the specified [link asio.reference.error_code `error_code`]. +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 [link asio.reference.error_code `error_code`] is converted to [link asio.reference.system_error `system_error`] and thrown. This operator may be used to specify an [link asio.reference.error_code `error_code`] object that should instead be set with the asynchronous operation's result. For example: +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 - void my_coroutine(basic_yield_context yield) - { - ... - std::size_t n = my_socket.async_read_some(buffer, yield[ec]); - if (ec) - { - // An error occurred. - } - ... - } + void my_coroutine(basic_yield_context yield) + { + ... + std::size_t n = my_socket.async_read_some(buffer, yield[ec]); + if (ec) + { + // An error occurred. + } + ... + } @@ -71976,7 +72483,8 @@ Reset the cancellation state associated with the coroutine. Filter && filter) const; -Let `P` be the cancellation slot associated with the current coroutine's [link asio.reference.spawn `spawn`] completion handler. Assigns a new [link asio.reference.cancellation_state `cancellation_state`] object `S`, constructed as `S(P, std::forward(filter))`, into the current coroutine's cancellation state object. +Let `P` be the cancellation slot associated with the current coroutine's [link asio.reference.spawn `spawn`] completion handler. Assigns a new [link asio.reference.cancellation_state `cancellation_state`] object `S`, constructed as `S(P, +std::forward(filter))`, into the current coroutine's cancellation state object. [endsect] @@ -72067,7 +72575,7 @@ Associate an object of type `T` with an allocator of type `Allocator`. template< typename Allocator, typename T> - allocator_binder< typename decay< T >::type, Allocator > bind_allocator( + allocator_binder< decay_t< T >, Allocator > bind_allocator( const Allocator & s, T && t); @@ -72093,7 +72601,7 @@ Associate an object of type `T` with a cancellation slot of type `CancellationSl template< typename ``[link asio.reference.CancellationSlot CancellationSlot]``, typename T> - cancellation_slot_binder< typename decay< T >::type, CancellationSlot > bind_cancellation_slot( + cancellation_slot_binder< decay_t< T >, CancellationSlot > bind_cancellation_slot( const CancellationSlot & s, T && t); @@ -72117,10 +72625,10 @@ Associate an object of type `T` with an executor of type `Executor`. template< typename ``[link asio.reference.Executor1 Executor]``, typename T> - executor_binder< typename decay< T >::type, Executor > ``[link asio.reference.bind_executor.overload1 bind_executor]``( + executor_binder< decay_t< T >, Executor > ``[link asio.reference.bind_executor.overload1 bind_executor]``( const Executor & ex, T && t, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.bind_executor.overload1 more...]]`` Associate an object of type `T` with an execution context's executor. @@ -72128,10 +72636,10 @@ 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 > ``[link asio.reference.bind_executor.overload2 bind_executor]``( + executor_binder< decay_t< T >, typename ExecutionContext::executor_type > ``[link asio.reference.bind_executor.overload2 bind_executor]``( ExecutionContext & ctx, T && t, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.bind_executor.overload2 more...]]`` [heading Requirements] @@ -72150,10 +72658,10 @@ Associate an object of type `T` with an executor of type `Executor`. template< typename ``[link asio.reference.Executor1 Executor]``, typename T> - executor_binder< typename decay< T >::type, Executor > bind_executor( + executor_binder< decay_t< T >, Executor > bind_executor( const Executor & ex, T && t, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -72170,10 +72678,10 @@ 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( + executor_binder< decay_t< T >, typename ExecutionContext::executor_type > bind_executor( ExecutionContext & ctx, T && t, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -72193,7 +72701,7 @@ Associate an object of type `T` with a immediate executor of type `Executor`. template< typename ``[link asio.reference.Executor1 Executor]``, typename T> - immediate_executor_binder< typename decay< T >::type, Executor > bind_immediate_executor( + immediate_executor_binder< decay_t< T >, Executor > bind_immediate_executor( const Executor & e, T && t); @@ -72212,7 +72720,7 @@ Associate an object of type `T` with a immediate executor of type `Executor`. [indexterm1 asio.indexterm.buffer..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. +The [link asio.reference.buffer `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. @@ -72257,14 +72765,14 @@ Create a new modifiable buffer that represents the given POD array. typename PodType, std::size_t N> mutable_buffer ``[link asio.reference.buffer.overload7 buffer]``( - PodType (&data)[N]); + PodType((&data)[N]); `` [''''»''' [link asio.reference.buffer.overload7 more...]]`` template< typename PodType, std::size_t N> mutable_buffer ``[link asio.reference.buffer.overload8 buffer]``( - PodType (&data)[N], + PodType((&data)[N], std::size_t max_size_in_bytes); `` [''''»''' [link asio.reference.buffer.overload8 more...]]`` @@ -72274,14 +72782,14 @@ Create a new non-modifiable buffer that represents the given POD array. typename PodType, std::size_t N> const_buffer ``[link asio.reference.buffer.overload9 buffer]``( - const PodType (&data)[N]); + const PodType((&data)[N]); `` [''''»''' [link asio.reference.buffer.overload9 more...]]`` template< typename PodType, std::size_t N> const_buffer ``[link asio.reference.buffer.overload10 buffer]``( - const PodType (&data)[N], + const PodType((&data)[N], std::size_t max_size_in_bytes); `` [''''»''' [link asio.reference.buffer.overload10 more...]]`` @@ -72319,103 +72827,73 @@ Create a new non-modifiable buffer that represents the given POD array. std::size_t max_size_in_bytes); `` [''''»''' [link asio.reference.buffer.overload14 more...]]`` - template< - typename PodType, - std::size_t N> - const_buffer ``[link asio.reference.buffer.overload15 buffer]``( - const boost::array< PodType, N > & data); - `` [''''»''' [link asio.reference.buffer.overload15 more...]]`` - - template< - typename PodType, - std::size_t N> - const_buffer ``[link asio.reference.buffer.overload16 buffer]``( - const boost::array< PodType, N > & data, - std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload16 more...]]`` - Create a new modifiable buffer that represents the given POD array. template< typename PodType, std::size_t N> - mutable_buffer ``[link asio.reference.buffer.overload17 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload15 buffer]``( std::array< PodType, N > & data); - `` [''''»''' [link asio.reference.buffer.overload17 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload15 more...]]`` template< typename PodType, std::size_t N> - mutable_buffer ``[link asio.reference.buffer.overload18 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload16 buffer]``( std::array< PodType, N > & data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload18 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload16 more...]]`` Create a new non-modifiable buffer that represents the given POD array. template< typename PodType, std::size_t N> - const_buffer ``[link asio.reference.buffer.overload19 buffer]``( + const_buffer ``[link asio.reference.buffer.overload17 buffer]``( std::array< const PodType, N > & data); - `` [''''»''' [link asio.reference.buffer.overload19 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload17 more...]]`` template< typename PodType, std::size_t N> - const_buffer ``[link asio.reference.buffer.overload20 buffer]``( + const_buffer ``[link asio.reference.buffer.overload18 buffer]``( std::array< const PodType, N > & data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload20 more...]]`` - - template< - typename PodType, - std::size_t N> - const_buffer ``[link asio.reference.buffer.overload21 buffer]``( - const std::array< PodType, N > & data); - `` [''''»''' [link asio.reference.buffer.overload21 more...]]`` - - template< - typename PodType, - std::size_t N> - const_buffer ``[link asio.reference.buffer.overload22 buffer]``( - const std::array< PodType, N > & data, - std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload22 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload18 more...]]`` Create a new modifiable buffer that represents the given POD vector. template< typename PodType, typename Allocator> - mutable_buffer ``[link asio.reference.buffer.overload23 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload19 buffer]``( std::vector< PodType, Allocator > & data); - `` [''''»''' [link asio.reference.buffer.overload23 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload19 more...]]`` template< typename PodType, typename Allocator> - mutable_buffer ``[link asio.reference.buffer.overload24 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload20 buffer]``( std::vector< PodType, Allocator > & data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload24 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload20 more...]]`` Create a new non-modifiable buffer that represents the given POD vector. template< typename PodType, typename Allocator> - const_buffer ``[link asio.reference.buffer.overload25 buffer]``( + const_buffer ``[link asio.reference.buffer.overload21 buffer]``( const std::vector< PodType, Allocator > & data); - `` [''''»''' [link asio.reference.buffer.overload25 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload21 more...]]`` template< typename PodType, typename Allocator> - const_buffer ``[link asio.reference.buffer.overload26 buffer]``( + const_buffer ``[link asio.reference.buffer.overload22 buffer]``( const std::vector< PodType, Allocator > & data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload26 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload22 more...]]`` Create a new modifiable buffer that represents the given string. @@ -72423,18 +72901,18 @@ Create a new modifiable buffer that represents the given string. typename Elem, typename Traits, typename Allocator> - mutable_buffer ``[link asio.reference.buffer.overload27 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload23 buffer]``( std::basic_string< Elem, Traits, Allocator > & data); - `` [''''»''' [link asio.reference.buffer.overload27 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload23 more...]]`` template< typename Elem, typename Traits, typename Allocator> - mutable_buffer ``[link asio.reference.buffer.overload28 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload24 buffer]``( std::basic_string< Elem, Traits, Allocator > & data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload28 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload24 more...]]`` Create a new non-modifiable buffer that represents the given string. @@ -72442,124 +72920,124 @@ Create a new non-modifiable buffer that represents the given string. typename Elem, typename Traits, typename Allocator> - const_buffer ``[link asio.reference.buffer.overload29 buffer]``( + const_buffer ``[link asio.reference.buffer.overload25 buffer]``( const std::basic_string< Elem, Traits, Allocator > & data); - `` [''''»''' [link asio.reference.buffer.overload29 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload25 more...]]`` template< typename Elem, typename Traits, typename Allocator> - const_buffer ``[link asio.reference.buffer.overload30 buffer]``( + const_buffer ``[link asio.reference.buffer.overload26 buffer]``( const std::basic_string< Elem, Traits, Allocator > & data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload30 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload26 more...]]`` Create a new non-modifiable buffer that represents the given string\_view. template< typename Elem, typename Traits> - const_buffer ``[link asio.reference.buffer.overload31 buffer]``( + const_buffer ``[link asio.reference.buffer.overload27 buffer]``( basic_string_view< Elem, Traits > data); - `` [''''»''' [link asio.reference.buffer.overload31 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload27 more...]]`` Create a new non-modifiable buffer that represents the given string. template< typename Elem, typename Traits> - const_buffer ``[link asio.reference.buffer.overload32 buffer]``( + const_buffer ``[link asio.reference.buffer.overload28 buffer]``( basic_string_view< Elem, Traits > data, std::size_t max_size_in_bytes); - `` [''''»''' [link asio.reference.buffer.overload32 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload28 more...]]`` Create a new modifiable buffer from a contiguous container. template< typename T> - mutable_buffer ``[link asio.reference.buffer.overload33 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload29 buffer]``( T & data, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); - `` [''''»''' [link asio.reference.buffer.overload33 more...]]`` + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); + `` [''''»''' [link asio.reference.buffer.overload29 more...]]`` template< typename T> - mutable_buffer ``[link asio.reference.buffer.overload34 buffer]``( + mutable_buffer ``[link asio.reference.buffer.overload30 buffer]``( T & data, std::size_t max_size_in_bytes, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); - `` [''''»''' [link asio.reference.buffer.overload34 more...]]`` + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); + `` [''''»''' [link asio.reference.buffer.overload30 more...]]`` Create a new non-modifiable buffer from a contiguous container. template< typename T> - const_buffer ``[link asio.reference.buffer.overload35 buffer]``( + const_buffer ``[link asio.reference.buffer.overload31 buffer]``( T & data, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); - `` [''''»''' [link asio.reference.buffer.overload35 more...]]`` + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); + `` [''''»''' [link asio.reference.buffer.overload31 more...]]`` template< typename T> - const_buffer ``[link asio.reference.buffer.overload36 buffer]``( + const_buffer ``[link asio.reference.buffer.overload32 buffer]``( T & data, std::size_t max_size_in_bytes, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); - `` [''''»''' [link asio.reference.buffer.overload36 more...]]`` + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); + `` [''''»''' [link asio.reference.buffer.overload32 more...]]`` template< typename T> - const_buffer ``[link asio.reference.buffer.overload37 buffer]``( + const_buffer ``[link asio.reference.buffer.overload33 buffer]``( const T & data, - typename constraint< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint()); - `` [''''»''' [link asio.reference.buffer.overload37 more...]]`` + constraint_t< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint()); + `` [''''»''' [link asio.reference.buffer.overload33 more...]]`` template< typename T> - const_buffer ``[link asio.reference.buffer.overload38 buffer]``( + const_buffer ``[link asio.reference.buffer.overload34 buffer]``( const T & data, std::size_t max_size_in_bytes, - typename constraint< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint()); - `` [''''»''' [link asio.reference.buffer.overload38 more...]]`` + constraint_t< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint()); + `` [''''»''' [link asio.reference.buffer.overload34 more...]]`` Obtain a buffer representing the entire registered buffer. - mutable_registered_buffer ``[link asio.reference.buffer.overload39 buffer]``( + mutable_registered_buffer ``[link asio.reference.buffer.overload35 buffer]``( const mutable_registered_buffer & b); - `` [''''»''' [link asio.reference.buffer.overload39 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload35 more...]]`` - const_registered_buffer ``[link asio.reference.buffer.overload40 buffer]``( + const_registered_buffer ``[link asio.reference.buffer.overload36 buffer]``( const const_registered_buffer & b); - `` [''''»''' [link asio.reference.buffer.overload40 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload36 more...]]`` Obtain a buffer representing part of a registered buffer. - mutable_registered_buffer ``[link asio.reference.buffer.overload41 buffer]``( + mutable_registered_buffer ``[link asio.reference.buffer.overload37 buffer]``( const mutable_registered_buffer & b, std::size_t n); - `` [''''»''' [link asio.reference.buffer.overload41 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload37 more...]]`` - const_registered_buffer ``[link asio.reference.buffer.overload42 buffer]``( + const_registered_buffer ``[link asio.reference.buffer.overload38 buffer]``( const const_registered_buffer & b, std::size_t n); - `` [''''»''' [link asio.reference.buffer.overload42 more...]]`` + `` [''''»''' [link asio.reference.buffer.overload38 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 [link asio.reference.mutable_buffer `mutable_buffer`] and [link asio.reference.const_buffer `const_buffer`], respectively. To mirror C++'s conversion rules, a [link asio.reference.mutable_buffer `mutable_buffer`] is implicitly convertible to a [link asio.reference.const_buffer `const_buffer`], and the opposite conversion is not permitted. @@ -72567,28 +73045,28 @@ The simplest use case involves reading or writing a single buffer of a specified - sock.send(asio::buffer(data, 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. +In the above example, the return value of [link asio.reference.buffer `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)); + size_t bytes_transferred = sock.receive(asio::buffer(d1)); - std::vector d2(128); - bytes_transferred = sock.receive(asio::buffer(d2)); + std::vector d2(128); + bytes_transferred = sock.receive(asio::buffer(d2)); - std::array d3; - bytes_transferred = sock.receive(asio::buffer(d3)); + std::array d3; + bytes_transferred = sock.receive(asio::buffer(d3)); - boost::array d4; - bytes_transferred = sock.receive(asio::buffer(d4)); + boost::array d4; + bytes_transferred = sock.receive(asio::buffer(d4)); @@ -72605,12 +73083,12 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::mutable_buffer b1 = ...; - std::size_t s1 = b1.size(); - unsigned char* p1 = static_cast(b1.data()); + 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(); + asio::const_buffer b2 = ...; + std::size_t s2 = b2.size(); + const void* p2 = b2.data(); @@ -72632,8 +73110,8 @@ In particular, when used with the [link asio.reference.buffer_size `buffer_size` vector buffers = ...; - vector data(asio::buffer_size(buffers)); - asio::buffer_copy(asio::buffer(data), buffers); + vector data(asio::buffer_size(buffers)); + asio::buffer_copy(asio::buffer(data), buffers); @@ -72647,9 +73125,9 @@ Note that [link asio.reference.buffer_copy `buffer_copy`] is implemented in term 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 [link asio.reference.buffer `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). +For the [link asio.reference.buffer `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). [heading Buffer Arithmetic] @@ -72660,7 +73138,7 @@ Buffer objects may be manipulated using simple arithmetic in a safe way which he - boost::array a = { 'a', 'b', 'c', 'd', 'e' }; + boost::array a = { 'a', 'b', 'c', 'd', 'e' }; @@ -72669,16 +73147,16 @@ A buffer object `b1` created using: - b1 = asio::buffer(a); + 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: +represents the entire array, `{ 'a', 'b', 'c', 'd', 'e' }`. An optional second argument to the [link asio.reference.buffer `buffer`] function may be used to limit the size, in bytes, of the buffer: - b2 = asio::buffer(a, 3); + b2 = asio::buffer(a, 3); @@ -72689,7 +73167,7 @@ An offset may be applied to an existing buffer to create a new one: - b3 = b1 + 2; + b3 = b1 + 2; @@ -72700,7 +73178,7 @@ Both an offset and size may be specified to create a buffer that corresponds to - b4 = asio::buffer(b1 + 1, 3); + b4 = asio::buffer(b1 + 1, 3); @@ -72716,21 +73194,21 @@ To read or write using multiple buffers (i.e. scatter-gather I/O), multiple buff - char d1[128]; - std::vector d2(128); - boost::array d3; + 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); + 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); + 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); @@ -72740,16 +73218,16 @@ To read or write using multiple buffers (i.e. scatter-gather I/O), multiple buff -The `\_buf` literal suffix, defined in namespace `asio::buffer_literals`, may be used to create `const_buffer` objects from string, binary integer, and hexadecimal integer literals. For example: +The `_buf` literal suffix, defined in namespace `asio::buffer_literals`, may be used to create `const_buffer` objects from string, binary integer, and hexadecimal integer literals. For example: - using namespace asio::buffer_literals; + using namespace asio::buffer_literals; - asio::const_buffer b1 = "hello"_buf; - asio::const_buffer b2 = 0xdeadbeef_buf; - asio::const_buffer b3 = 0x0123456789abcdef0123456789abcdef_buf; - asio::const_buffer b4 = 0b1010101011001100_buf; + asio::const_buffer b1 = "hello"_buf; + asio::const_buffer b2 = 0xdeadbeef_buf; + asio::const_buffer b3 = 0x0123456789abcdef0123456789abcdef_buf; + asio::const_buffer b4 = 0b1010101011001100_buf; @@ -72763,7 +73241,7 @@ Note that the memory associated with a buffer literal is valid for the lifetime ['Convenience header: ][^asio.hpp] -[section:overload1 buffer (1 of 42 overloads)] +[section:overload1 buffer (1 of 38 overloads)] Create a new modifiable buffer from an existing buffer. @@ -72785,7 +73263,7 @@ Create a new modifiable buffer from an existing buffer. -[section:overload2 buffer (2 of 42 overloads)] +[section:overload2 buffer (2 of 38 overloads)] Create a new modifiable buffer from an existing buffer. @@ -72801,9 +73279,9 @@ Create a new modifiable buffer from an existing buffer. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - b.data(), - min(b.size(), max_size_in_bytes)); + mutable_buffer( + b.data(), + min(b.size(), max_size_in_bytes)); @@ -72815,7 +73293,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload3 buffer (3 of 42 overloads)] +[section:overload3 buffer (3 of 38 overloads)] Create a new non-modifiable buffer from an existing buffer. @@ -72837,7 +73315,7 @@ Create a new non-modifiable buffer from an existing buffer. -[section:overload4 buffer (4 of 42 overloads)] +[section:overload4 buffer (4 of 38 overloads)] Create a new non-modifiable buffer from an existing buffer. @@ -72853,9 +73331,9 @@ Create a new non-modifiable buffer from an existing buffer. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - b.data(), - min(b.size(), max_size_in_bytes)); + const_buffer( + b.data(), + min(b.size(), max_size_in_bytes)); @@ -72867,7 +73345,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload5 buffer (5 of 42 overloads)] +[section:overload5 buffer (5 of 38 overloads)] Create a new modifiable buffer that represents the given memory range. @@ -72890,7 +73368,7 @@ Create a new modifiable buffer that represents the given memory range. -[section:overload6 buffer (6 of 42 overloads)] +[section:overload6 buffer (6 of 38 overloads)] Create a new non-modifiable buffer that represents the given memory range. @@ -72913,7 +73391,7 @@ Create a new non-modifiable buffer that represents the given memory range. -[section:overload7 buffer (7 of 42 overloads)] +[section:overload7 buffer (7 of 38 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -72923,7 +73401,7 @@ Create a new modifiable buffer that represents the given POD array. typename PodType, std::size_t N> mutable_buffer buffer( - PodType (&data)[N]); + PodType((&data)[N]); @@ -72931,9 +73409,9 @@ Create a new modifiable buffer that represents the given POD array. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - static_cast(data), - N * sizeof(PodType)); + mutable_buffer( + static_cast(data), + N * sizeof(PodType)); @@ -72945,7 +73423,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload8 buffer (8 of 42 overloads)] +[section:overload8 buffer (8 of 38 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -72955,7 +73433,7 @@ Create a new modifiable buffer that represents the given POD array. typename PodType, std::size_t N> mutable_buffer buffer( - PodType (&data)[N], + PodType((&data)[N], std::size_t max_size_in_bytes); @@ -72964,9 +73442,9 @@ Create a new modifiable buffer that represents the given POD array. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - static_cast(data), - min(N * sizeof(PodType), max_size_in_bytes)); + mutable_buffer( + static_cast(data), + min(N * sizeof(PodType), max_size_in_bytes)); @@ -72978,7 +73456,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload9 buffer (9 of 42 overloads)] +[section:overload9 buffer (9 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -72988,7 +73466,7 @@ Create a new non-modifiable buffer that represents the given POD array. typename PodType, std::size_t N> const_buffer buffer( - const PodType (&data)[N]); + const PodType((&data)[N]); @@ -72996,9 +73474,9 @@ Create a new non-modifiable buffer that represents the given POD array. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - static_cast(data), - N * sizeof(PodType)); + const_buffer( + static_cast(data), + N * sizeof(PodType)); @@ -73010,7 +73488,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload10 buffer (10 of 42 overloads)] +[section:overload10 buffer (10 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -73020,7 +73498,7 @@ Create a new non-modifiable buffer that represents the given POD array. typename PodType, std::size_t N> const_buffer buffer( - const PodType (&data)[N], + const PodType((&data)[N], std::size_t max_size_in_bytes); @@ -73029,9 +73507,9 @@ Create a new non-modifiable buffer that represents the given POD array. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - static_cast(data), - min(N * sizeof(PodType), max_size_in_bytes)); + const_buffer( + static_cast(data), + min(N * sizeof(PodType), max_size_in_bytes)); @@ -73043,7 +73521,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload11 buffer (11 of 42 overloads)] +[section:overload11 buffer (11 of 38 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -73061,9 +73539,9 @@ Create a new modifiable buffer that represents the given POD array. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.data(), - data.size() * sizeof(PodType)); + mutable_buffer( + data.data(), + data.size() * sizeof(PodType)); @@ -73075,7 +73553,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload12 buffer (12 of 42 overloads)] +[section:overload12 buffer (12 of 38 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -73094,9 +73572,9 @@ Create a new modifiable buffer that represents the given POD array. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.data(), - min(data.size() * sizeof(PodType), max_size_in_bytes)); + mutable_buffer( + data.data(), + min(data.size() * sizeof(PodType), max_size_in_bytes)); @@ -73108,7 +73586,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload13 buffer (13 of 42 overloads)] +[section:overload13 buffer (13 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -73126,9 +73604,9 @@ Create a new non-modifiable buffer that represents the given POD array. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.data(), - data.size() * sizeof(PodType)); + const_buffer( + data.data(), + data.size() * sizeof(PodType)); @@ -73140,7 +73618,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload14 buffer (14 of 42 overloads)] +[section:overload14 buffer (14 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -73159,74 +73637,9 @@ Create a new non-modifiable buffer that represents the given POD array. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.data(), - min(data.size() * sizeof(PodType), max_size_in_bytes)); - - - - - - - -[endsect] - - - -[section:overload15 buffer (15 of 42 overloads)] - - -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); - - - -[heading Return Value] - -A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - - const_buffer( - data.data(), - data.size() * sizeof(PodType)); - - - - - - - -[endsect] - - - -[section:overload16 buffer (16 of 42 overloads)] - - -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); - - - -[heading Return Value] - -A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - - const_buffer( - data.data(), - min(data.size() * sizeof(PodType), max_size_in_bytes)); + const_buffer( + data.data(), + min(data.size() * sizeof(PodType), max_size_in_bytes)); @@ -73238,7 +73651,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload17 buffer (17 of 42 overloads)] +[section:overload15 buffer (15 of 38 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -73256,9 +73669,9 @@ Create a new modifiable buffer that represents the given POD array. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.data(), - data.size() * sizeof(PodType)); + mutable_buffer( + data.data(), + data.size() * sizeof(PodType)); @@ -73270,7 +73683,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload18 buffer (18 of 42 overloads)] +[section:overload16 buffer (16 of 38 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -73289,9 +73702,9 @@ Create a new modifiable buffer that represents the given POD array. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.data(), - min(data.size() * sizeof(PodType), max_size_in_bytes)); + mutable_buffer( + data.data(), + min(data.size() * sizeof(PodType), max_size_in_bytes)); @@ -73303,7 +73716,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload19 buffer (19 of 42 overloads)] +[section:overload17 buffer (17 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -73321,9 +73734,9 @@ Create a new non-modifiable buffer that represents the given POD array. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.data(), - data.size() * sizeof(PodType)); + const_buffer( + data.data(), + data.size() * sizeof(PodType)); @@ -73335,7 +73748,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload20 buffer (20 of 42 overloads)] +[section:overload18 buffer (18 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -73354,74 +73767,9 @@ Create a new non-modifiable buffer that represents the given POD array. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.data(), - min(data.size() * sizeof(PodType), max_size_in_bytes)); - - - - - - - -[endsect] - - - -[section:overload21 buffer (21 of 42 overloads)] - - -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); - - - -[heading Return Value] - -A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - - const_buffer( - data.data(), - data.size() * sizeof(PodType)); - - - - - - - -[endsect] - - - -[section:overload22 buffer (22 of 42 overloads)] - - -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); - - - -[heading Return Value] - -A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - - const_buffer( - data.data(), - min(data.size() * sizeof(PodType), max_size_in_bytes)); + const_buffer( + data.data(), + min(data.size() * sizeof(PodType), max_size_in_bytes)); @@ -73433,7 +73781,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload23 buffer (23 of 42 overloads)] +[section:overload19 buffer (19 of 38 overloads)] Create a new modifiable buffer that represents the given POD vector. @@ -73451,9 +73799,9 @@ Create a new modifiable buffer that represents the given POD vector. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.size() ? &data[0] : 0, - data.size() * sizeof(PodType)); + mutable_buffer( + data.size() ? &data[0] : 0, + data.size() * sizeof(PodType)); @@ -73470,7 +73818,7 @@ The buffer is invalidated by any vector operation that would also invalidate ite -[section:overload24 buffer (24 of 42 overloads)] +[section:overload20 buffer (20 of 38 overloads)] Create a new modifiable buffer that represents the given POD vector. @@ -73489,9 +73837,9 @@ Create a new modifiable buffer that represents the given POD vector. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.size() ? &data[0] : 0, - min(data.size() * sizeof(PodType), max_size_in_bytes)); + mutable_buffer( + data.size() ? &data[0] : 0, + min(data.size() * sizeof(PodType), max_size_in_bytes)); @@ -73508,7 +73856,7 @@ The buffer is invalidated by any vector operation that would also invalidate ite -[section:overload25 buffer (25 of 42 overloads)] +[section:overload21 buffer (21 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD vector. @@ -73526,9 +73874,9 @@ Create a new non-modifiable buffer that represents the given POD vector. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.size() ? &data[0] : 0, - data.size() * sizeof(PodType)); + const_buffer( + data.size() ? &data[0] : 0, + data.size() * sizeof(PodType)); @@ -73545,7 +73893,7 @@ The buffer is invalidated by any vector operation that would also invalidate ite -[section:overload26 buffer (26 of 42 overloads)] +[section:overload22 buffer (22 of 38 overloads)] Create a new non-modifiable buffer that represents the given POD vector. @@ -73564,9 +73912,9 @@ Create a new non-modifiable buffer that represents the given POD vector. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.size() ? &data[0] : 0, - min(data.size() * sizeof(PodType), max_size_in_bytes)); + const_buffer( + data.size() ? &data[0] : 0, + min(data.size() * sizeof(PodType), max_size_in_bytes)); @@ -73583,7 +73931,7 @@ The buffer is invalidated by any vector operation that would also invalidate ite -[section:overload27 buffer (27 of 42 overloads)] +[section:overload23 buffer (23 of 38 overloads)] Create a new modifiable buffer that represents the given string. @@ -73614,7 +73962,7 @@ The buffer is invalidated by any non-const operation called on the given string -[section:overload28 buffer (28 of 42 overloads)] +[section:overload24 buffer (24 of 38 overloads)] Create a new modifiable buffer that represents the given string. @@ -73634,9 +73982,9 @@ Create a new modifiable buffer that represents the given string. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.size() ? &data[0] : 0, - min(data.size() * sizeof(Elem), max_size_in_bytes)); + mutable_buffer( + data.size() ? &data[0] : 0, + min(data.size() * sizeof(Elem), max_size_in_bytes)); @@ -73653,7 +74001,7 @@ The buffer is invalidated by any non-const operation called on the given string -[section:overload29 buffer (29 of 42 overloads)] +[section:overload25 buffer (25 of 38 overloads)] Create a new non-modifiable buffer that represents the given string. @@ -73684,7 +74032,7 @@ The buffer is invalidated by any non-const operation called on the given string -[section:overload30 buffer (30 of 42 overloads)] +[section:overload26 buffer (26 of 38 overloads)] Create a new non-modifiable buffer that represents the given string. @@ -73704,9 +74052,9 @@ Create a new non-modifiable buffer that represents the given string. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.data(), - min(data.size() * sizeof(Elem), max_size_in_bytes)); + const_buffer( + data.data(), + min(data.size() * sizeof(Elem), max_size_in_bytes)); @@ -73723,7 +74071,7 @@ The buffer is invalidated by any non-const operation called on the given string -[section:overload31 buffer (31 of 42 overloads)] +[section:overload27 buffer (27 of 38 overloads)] Create a new non-modifiable buffer that represents the given string\_view. @@ -73748,7 +74096,7 @@ Create a new non-modifiable buffer that represents the given string\_view. -[section:overload32 buffer (32 of 42 overloads)] +[section:overload28 buffer (28 of 38 overloads)] Create a new non-modifiable buffer that represents the given string. @@ -73767,9 +74115,9 @@ Create a new non-modifiable buffer that represents the given string. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.size() ? &data[0] : 0, - min(data.size() * sizeof(Elem), max_size_in_bytes)); + mutable_buffer( + data.size() ? &data[0] : 0, + min(data.size() * sizeof(Elem), max_size_in_bytes)); @@ -73781,7 +74129,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload33 buffer (33 of 42 overloads)] +[section:overload29 buffer (29 of 38 overloads)] Create a new modifiable buffer from a contiguous container. @@ -73791,10 +74139,10 @@ Create a new modifiable buffer from a contiguous container. typename T> mutable_buffer buffer( T & data, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); @@ -73802,9 +74150,9 @@ Create a new modifiable buffer from a contiguous container. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.size() ? &data[0] : 0, - data.size() * sizeof(typename T::value_type)); + mutable_buffer( + data.size() ? &data[0] : 0, + data.size() * sizeof(typename T::value_type)); @@ -73816,7 +74164,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload34 buffer (34 of 42 overloads)] +[section:overload30 buffer (30 of 38 overloads)] Create a new modifiable buffer from a contiguous container. @@ -73827,10 +74175,10 @@ Create a new modifiable buffer from a contiguous container. mutable_buffer buffer( T & data, std::size_t max_size_in_bytes, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); @@ -73838,11 +74186,11 @@ Create a new modifiable buffer from a contiguous container. A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: - mutable_buffer( - data.size() ? &data[0] : 0, - min( - data.size() * sizeof(typename T::value_type), - max_size_in_bytes)); + mutable_buffer( + data.size() ? &data[0] : 0, + min( + data.size() * sizeof(typename T::value_type), + max_size_in_bytes)); @@ -73854,7 +74202,7 @@ A [link asio.reference.mutable_buffer `mutable_buffer`] value equivalent to: -[section:overload35 buffer (35 of 42 overloads)] +[section:overload31 buffer (31 of 38 overloads)] Create a new non-modifiable buffer from a contiguous container. @@ -73864,10 +74212,10 @@ Create a new non-modifiable buffer from a contiguous container. typename T> const_buffer buffer( T & data, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); @@ -73875,9 +74223,9 @@ Create a new non-modifiable buffer from a contiguous container. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.size() ? &data[0] : 0, - data.size() * sizeof(typename T::value_type)); + const_buffer( + data.size() ? &data[0] : 0, + data.size() * sizeof(typename T::value_type)); @@ -73889,7 +74237,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload36 buffer (36 of 42 overloads)] +[section:overload32 buffer (32 of 38 overloads)] Create a new non-modifiable buffer from a contiguous container. @@ -73900,10 +74248,10 @@ Create a new non-modifiable buffer from a contiguous container. const_buffer buffer( T & data, std::size_t max_size_in_bytes, - typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint > = defaulted_constraint()); @@ -73911,11 +74259,11 @@ Create a new non-modifiable buffer from a contiguous container. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.size() ? &data[0] : 0, - min( - data.size() * sizeof(typename T::value_type), - max_size_in_bytes)); + const_buffer( + data.size() ? &data[0] : 0, + min( + data.size() * sizeof(typename T::value_type), + max_size_in_bytes)); @@ -73927,7 +74275,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload37 buffer (37 of 42 overloads)] +[section:overload33 buffer (33 of 38 overloads)] Create a new non-modifiable buffer from a contiguous container. @@ -73937,9 +74285,9 @@ Create a new non-modifiable buffer from a contiguous container. typename T> const_buffer buffer( const T & data, - typename constraint< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint()); @@ -73947,9 +74295,9 @@ Create a new non-modifiable buffer from a contiguous container. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.size() ? &data[0] : 0, - data.size() * sizeof(typename T::value_type)); + const_buffer( + data.size() ? &data[0] : 0, + data.size() * sizeof(typename T::value_type)); @@ -73961,7 +74309,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload38 buffer (38 of 42 overloads)] +[section:overload34 buffer (34 of 38 overloads)] Create a new non-modifiable buffer from a contiguous container. @@ -73972,9 +74320,9 @@ Create a new non-modifiable buffer from a contiguous container. const_buffer buffer( const T & data, std::size_t max_size_in_bytes, - typename constraint< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type = defaulted_constraint(), - typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint > = defaulted_constraint(), + constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint > = defaulted_constraint()); @@ -73982,11 +74330,11 @@ Create a new non-modifiable buffer from a contiguous container. A [link asio.reference.const_buffer `const_buffer`] value equivalent to: - const_buffer( - data.size() ? &data[0] : 0, - min( - data.size() * sizeof(typename T::value_type), - max_size_in_bytes)); + const_buffer( + data.size() ? &data[0] : 0, + min( + data.size() * sizeof(typename T::value_type), + max_size_in_bytes)); @@ -73998,7 +74346,7 @@ A [link asio.reference.const_buffer `const_buffer`] value equivalent to: -[section:overload39 buffer (39 of 42 overloads)] +[section:overload35 buffer (35 of 38 overloads)] Obtain a buffer representing the entire registered buffer. @@ -74013,7 +74361,7 @@ Obtain a buffer representing the entire registered buffer. -[section:overload40 buffer (40 of 42 overloads)] +[section:overload36 buffer (36 of 38 overloads)] Obtain a buffer representing the entire registered buffer. @@ -74028,7 +74376,7 @@ Obtain a buffer representing the entire registered buffer. -[section:overload41 buffer (41 of 42 overloads)] +[section:overload37 buffer (37 of 38 overloads)] Obtain a buffer representing part of a registered buffer. @@ -74044,7 +74392,7 @@ Obtain a buffer representing part of a registered buffer. -[section:overload42 buffer (42 of 42 overloads)] +[section:overload38 buffer (38 of 38 overloads)] Obtain a buffer representing part of a registered buffer. @@ -74065,7 +74413,7 @@ Obtain a buffer representing part of a registered buffer. [indexterm1 asio.indexterm.buffer_cast..buffer_cast] -(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. +(Deprecated: Use the `data()` member function.) The [link asio.reference.buffer_cast `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. @@ -74090,7 +74438,7 @@ Cast a non-modifiable buffer to a specified pointer to POD type. To access the memory of a non-modifiable buffer, use: asio::const_buffer b1 = ...; - const unsigned char* p1 = asio::buffer_cast(b1); + const unsigned char* p1 = asio::buffer_cast(b1); @@ -74098,12 +74446,12 @@ To access the memory of a non-modifiable buffer, use: To access the memory of a modifiable buffer, use: asio::mutable_buffer b2 = ...; - unsigned char* p2 = asio::buffer_cast(b2); + unsigned char* p2 = asio::buffer_cast(b2); -The `asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered. +The [link asio.reference.buffer_cast `buffer_cast`] function permits violations of type safety, so uses of it in application code should be carefully considered. [heading Requirements] @@ -74151,7 +74499,7 @@ Cast a non-modifiable buffer to a specified pointer to POD type. [indexterm1 asio.indexterm.buffer_copy..buffer_copy] -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 [link asio.reference.buffer_copy `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. @@ -74539,7 +74887,7 @@ Register buffers with an executor's execution context. const Executor & ex, const MutableBufferSequence & buffer_sequence, const allocator_type & alloc = allocator_type(), - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.buffer_registration.buffer_registration.overload1 more...]]`` @@ -74552,7 +74900,7 @@ Register buffers with an execution context. ExecutionContext & ctx, const MutableBufferSequence & buffer_sequence, const allocator_type & alloc = allocator_type(), - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.buffer_registration.buffer_registration.overload2 more...]]`` @@ -74576,7 +74924,7 @@ Register buffers with an executor's execution context. const Executor & ex, const MutableBufferSequence & buffer_sequence, const allocator_type & alloc = allocator_type(), - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -74596,7 +74944,7 @@ Register buffers with an execution context. ExecutionContext & ctx, const MutableBufferSequence & buffer_sequence, const allocator_type & alloc = allocator_type(), - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -74769,7 +75117,7 @@ Unregisters the buffers. [indexterm1 asio.indexterm.buffer_sequence_begin..buffer_sequence_begin] -The `asio::buffer_sequence_begin` function returns an iterator pointing to the first element in a buffer sequence. +The [link asio.reference.buffer_sequence_begin `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. @@ -74778,28 +75126,28 @@ Get an iterator to the first element in a buffer sequence. typename MutableBuffer> const mutable_buffer * ``[link asio.reference.buffer_sequence_begin.overload1 buffer_sequence_begin]``( const MutableBuffer & b, - typename constraint< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type = 0); + constraint_t< is_convertible< const MutableBuffer *, const mutable_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_begin.overload1 more...]]`` template< typename ConstBuffer> const const_buffer * ``[link asio.reference.buffer_sequence_begin.overload2 buffer_sequence_begin]``( const ConstBuffer & b, - typename constraint< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type = 0); + constraint_t< is_convertible< const ConstBuffer *, const const_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_begin.overload2 more...]]`` template< typename C> auto ``[link asio.reference.buffer_sequence_begin.overload3 buffer_sequence_begin]``( C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_begin.overload3 more...]]`` template< typename C> auto ``[link asio.reference.buffer_sequence_begin.overload4 buffer_sequence_begin]``( const C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_begin.overload4 more...]]`` Get an iterator to the first element in a buffer sequence. @@ -74829,7 +75177,7 @@ Get an iterator to the first element in a buffer sequence. typename MutableBuffer> const mutable_buffer * buffer_sequence_begin( const MutableBuffer & b, - typename constraint< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type = 0); + constraint_t< is_convertible< const MutableBuffer *, const mutable_buffer * >::value > = 0); @@ -74847,7 +75195,7 @@ Get an iterator to the first element in a buffer sequence. typename ConstBuffer> const const_buffer * buffer_sequence_begin( const ConstBuffer & b, - typename constraint< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type = 0); + constraint_t< is_convertible< const ConstBuffer *, const const_buffer * >::value > = 0); @@ -74865,7 +75213,7 @@ Get an iterator to the first element in a buffer sequence. typename C> auto buffer_sequence_begin( C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); @@ -74883,7 +75231,7 @@ Get an iterator to the first element in a buffer sequence. typename C> auto buffer_sequence_begin( const C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); @@ -74926,7 +75274,7 @@ Get an iterator to the first element in a buffer sequence. [indexterm1 asio.indexterm.buffer_sequence_end..buffer_sequence_end] -The `asio::buffer_sequence_end` function returns an iterator pointing to one past the end element in a buffer sequence. +The [link asio.reference.buffer_sequence_end `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. @@ -74935,28 +75283,28 @@ Get an iterator to one past the end element in a buffer sequence. typename MutableBuffer> const mutable_buffer * ``[link asio.reference.buffer_sequence_end.overload1 buffer_sequence_end]``( const MutableBuffer & b, - typename constraint< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type = 0); + constraint_t< is_convertible< const MutableBuffer *, const mutable_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_end.overload1 more...]]`` template< typename ConstBuffer> const const_buffer * ``[link asio.reference.buffer_sequence_end.overload2 buffer_sequence_end]``( const ConstBuffer & b, - typename constraint< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type = 0); + constraint_t< is_convertible< const ConstBuffer *, const const_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_end.overload2 more...]]`` template< typename C> auto ``[link asio.reference.buffer_sequence_end.overload3 buffer_sequence_end]``( C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_end.overload3 more...]]`` template< typename C> auto ``[link asio.reference.buffer_sequence_end.overload4 buffer_sequence_end]``( const C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); `` [''''»''' [link asio.reference.buffer_sequence_end.overload4 more...]]`` Get an iterator to one past the end element in a buffer sequence. @@ -74986,7 +75334,7 @@ Get an iterator to one past the end element in a buffer sequence. typename MutableBuffer> const mutable_buffer * buffer_sequence_end( const MutableBuffer & b, - typename constraint< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type = 0); + constraint_t< is_convertible< const MutableBuffer *, const mutable_buffer * >::value > = 0); @@ -75004,7 +75352,7 @@ Get an iterator to one past the end element in a buffer sequence. typename ConstBuffer> const const_buffer * buffer_sequence_end( const ConstBuffer & b, - typename constraint< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type = 0); + constraint_t< is_convertible< const ConstBuffer *, const const_buffer * >::value > = 0); @@ -75022,7 +75370,7 @@ Get an iterator to one past the end element in a buffer sequence. typename C> auto buffer_sequence_end( C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); @@ -75040,7 +75388,7 @@ Get an iterator to one past the end element in a buffer sequence. typename C> auto buffer_sequence_end( const C & c, - typename constraint< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type = 0); + constraint_t< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value > = 0); @@ -75098,14 +75446,14 @@ The `buffer_size` function determines the total size of all buffers in the buffe 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; + 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; @@ -75281,9 +75629,9 @@ Start an asynchronous fill. template< - typename ``[link asio.reference.ReadHandler ReadHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_fill( - ReadHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.ReadHandler ReadHandler]`` = default_completion_token_t> + auto async_fill( + ReadHandler && handler = default_completion_token_t< executor_type >()); @@ -75291,7 +75639,7 @@ Start an asynchronous fill. - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -75311,10 +75659,10 @@ Start an asynchronous read. The buffer into which the data will be read must be template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadHandler ReadHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadHandler ReadHandler]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadHandler && handler = default_completion_token_t< executor_type >()); @@ -75322,7 +75670,7 @@ Start an asynchronous read. The buffer into which the data will be read must be - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -75342,10 +75690,10 @@ Start an asynchronous write. The data being written must be valid for the lifeti template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteHandler WriteHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteHandler WriteHandler]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteHandler && handler = default_completion_token_t< executor_type >()); @@ -75353,7 +75701,7 @@ Start an asynchronous write. The data being written must be valid for the lifeti - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -75693,7 +76041,7 @@ Get a reference to the next layer. The type of the next layer. - typedef remove_reference< Stream >::type next_layer_type; + typedef remove_reference_t< Stream > next_layer_type; @@ -76050,9 +76398,9 @@ Start an asynchronous fill. template< - typename ``[link asio.reference.ReadHandler ReadHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_fill( - ReadHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.ReadHandler ReadHandler]`` = default_completion_token_t> + auto async_fill( + ReadHandler && handler = default_completion_token_t< executor_type >()); @@ -76060,7 +76408,7 @@ Start an asynchronous fill. - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -76079,9 +76427,9 @@ Start an asynchronous flush. template< - typename ``[link asio.reference.WriteHandler WriteHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_flush( - WriteHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.WriteHandler WriteHandler]`` = default_completion_token_t> + auto async_flush( + WriteHandler && handler = default_completion_token_t< executor_type >()); @@ -76089,7 +76437,7 @@ Start an asynchronous flush. - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -76109,10 +76457,10 @@ Start an asynchronous read. The buffer into which the data will be read must be template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadHandler ReadHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadHandler ReadHandler]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadHandler && handler = default_completion_token_t< executor_type >()); @@ -76120,7 +76468,7 @@ Start an asynchronous read. The buffer into which the data will be read must be - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -76140,10 +76488,10 @@ Start an asynchronous write. The data being written must be valid for the lifeti template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteHandler WriteHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteHandler WriteHandler]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteHandler && handler = default_completion_token_t< executor_type >()); @@ -76151,7 +76499,7 @@ Start an asynchronous write. The data being written must be valid for the lifeti - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -76527,7 +76875,7 @@ Get a reference to the next layer. The type of the next layer. - typedef remove_reference< Stream >::type next_layer_type; + typedef remove_reference_t< Stream > next_layer_type; @@ -76883,9 +77231,9 @@ Start an asynchronous flush. template< - typename ``[link asio.reference.WriteHandler WriteHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_flush( - WriteHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.WriteHandler WriteHandler]`` = default_completion_token_t> + auto async_flush( + WriteHandler && handler = default_completion_token_t< executor_type >()); @@ -76893,7 +77241,7 @@ Start an asynchronous flush. - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -76913,10 +77261,10 @@ Start an asynchronous read. The buffer into which the data will be read must be template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadHandler ReadHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadHandler ReadHandler]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadHandler && handler = default_completion_token_t< executor_type >()); @@ -76924,7 +77272,7 @@ Start an asynchronous read. The buffer into which the data will be read must be - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -76944,10 +77292,10 @@ Start an asynchronous write. The data being written must be valid for the lifeti template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteHandler WriteHandler]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteHandler WriteHandler]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteHandler && handler = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteHandler && handler = default_completion_token_t< executor_type >()); @@ -76955,7 +77303,7 @@ Start an asynchronous write. The data being written must be valid for the lifeti - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -77295,7 +77643,7 @@ Get a reference to the next layer. The type of the next layer. - typedef remove_reference< Stream >::type next_layer_type; + typedef remove_reference_t< Stream > next_layer_type; @@ -77615,7 +77963,7 @@ A random access iterator over the bytes in a buffer sequence. ] [ - [[link asio.reference.buffers_iterator.operator__star_ [*operator *]]] + [[link asio.reference.buffers_iterator.operator_star_ [*operator*]]] [Dereference an iterator. ] ] @@ -77794,36 +78142,36 @@ The iterator category. -[section:operator__star_ buffers_iterator::operator *] +[section:operator_not__eq_ buffers_iterator::operator!=] -[indexterm2 asio.indexterm.buffers_iterator.operator__star_..operator *..buffers_iterator] -Dereference an iterator. +[indexterm2 asio.indexterm.buffers_iterator.operator_not__eq_..operator!=..buffers_iterator] +Test two iterators for inequality. - reference operator *() const; + bool operator!=( + const buffers_iterator & a, + const buffers_iterator & b); +[heading Requirements] -[endsect] +['Header: ][^asio/buffers_iterator.hpp] +['Convenience header: ][^asio.hpp] -[section:operator_not__eq_ buffers_iterator::operator!=] +[endsect] -[indexterm2 asio.indexterm.buffers_iterator.operator_not__eq_..operator!=..buffers_iterator] -Test two iterators for inequality. - friend bool operator!=( - const buffers_iterator & a, - const buffers_iterator & b); +[section:operator_star_ buffers_iterator::operator*] +[indexterm2 asio.indexterm.buffers_iterator.operator_star_..operator*..buffers_iterator] +Dereference an iterator. -[heading Requirements] -['Header: ][^asio/buffers_iterator.hpp] + reference operator*() const; -['Convenience header: ][^asio.hpp] [endsect] @@ -77835,12 +78183,12 @@ Test two iterators for inequality. Addition operator. - friend buffers_iterator ``[link asio.reference.buffers_iterator.operator_plus_.overload1 operator+]``( + buffers_iterator ``[link asio.reference.buffers_iterator.operator_plus_.overload1 operator+]``( const buffers_iterator & iter, std::ptrdiff_t difference); `` [''''»''' [link asio.reference.buffers_iterator.operator_plus_.overload1 more...]]`` - friend buffers_iterator ``[link asio.reference.buffers_iterator.operator_plus_.overload2 operator+]``( + buffers_iterator ``[link asio.reference.buffers_iterator.operator_plus_.overload2 operator+]``( std::ptrdiff_t difference, const buffers_iterator & iter); `` [''''»''' [link asio.reference.buffers_iterator.operator_plus_.overload2 more...]]`` @@ -77852,7 +78200,7 @@ Addition operator. Addition operator. - friend buffers_iterator operator+( + buffers_iterator operator+( const buffers_iterator & iter, std::ptrdiff_t difference); @@ -77874,7 +78222,7 @@ Addition operator. Addition operator. - friend buffers_iterator operator+( + buffers_iterator operator+( std::ptrdiff_t difference, const buffers_iterator & iter); @@ -77960,12 +78308,12 @@ Addition operator. Subtraction operator. - friend buffers_iterator ``[link asio.reference.buffers_iterator.operator_minus_.overload1 operator-]``( + buffers_iterator ``[link asio.reference.buffers_iterator.operator_minus_.overload1 operator-]``( const buffers_iterator & iter, std::ptrdiff_t difference); `` [''''»''' [link asio.reference.buffers_iterator.operator_minus_.overload1 more...]]`` - friend std::ptrdiff_t ``[link asio.reference.buffers_iterator.operator_minus_.overload2 operator-]``( + std::ptrdiff_t ``[link asio.reference.buffers_iterator.operator_minus_.overload2 operator-]``( const buffers_iterator & a, const buffers_iterator & b); `` [''''»''' [link asio.reference.buffers_iterator.operator_minus_.overload2 more...]]`` @@ -77977,7 +78325,7 @@ Subtraction operator. Subtraction operator. - friend buffers_iterator operator-( + buffers_iterator operator-( const buffers_iterator & iter, std::ptrdiff_t difference); @@ -77999,7 +78347,7 @@ Subtraction operator. Subtraction operator. - friend std::ptrdiff_t operator-( + std::ptrdiff_t operator-( const buffers_iterator & a, const buffers_iterator & b); @@ -78100,7 +78448,7 @@ Dereference an iterator. Compare two iterators. - friend bool operator<( + bool operator<( const buffers_iterator & a, const buffers_iterator & b); @@ -78122,7 +78470,7 @@ Compare two iterators. Compare two iterators. - friend bool operator<=( + bool operator<=( const buffers_iterator & a, const buffers_iterator & b); @@ -78144,7 +78492,7 @@ Compare two iterators. Test two iterators for equality. - friend bool operator==( + bool operator==( const buffers_iterator & a, const buffers_iterator & b); @@ -78166,7 +78514,7 @@ Test two iterators for equality. Compare two iterators. - friend bool operator>( + bool operator>( const buffers_iterator & a, const buffers_iterator & b); @@ -78188,7 +78536,7 @@ Compare two iterators. Compare two iterators. - friend bool operator>=( + bool operator>=( const buffers_iterator & a, const buffers_iterator & b); @@ -78299,7 +78647,8 @@ A type trait that determines whether a `prefer` expression is well-formed. template< typename T, typename... Properties> - struct can_prefer + struct can_prefer : + public integral_constant< bool, automatically_determined > Class template `can_prefer` is a trait that is derived from `true_type` if the expression `asio::prefer(std::declval(), std::declval()...)` is well formed; otherwise `false_type`. @@ -78324,7 +78673,8 @@ A type trait that determines whether a `query` expression is well-formed. template< typename T, typename Property> - struct can_query + struct can_query : + public integral_constant< bool, automatically_determined > Class template `can_query` is a trait that is derived from `true_type` if the expression `asio::query(std::declval(), std::declval())` is well formed; otherwise `false_type`. @@ -78349,7 +78699,8 @@ A type trait that determines whether a `require` expression is well-formed. template< typename T, typename... Properties> - struct can_require + struct can_require : + public integral_constant< bool, automatically_determined > Class template `can_require` is a trait that is derived from `true_type` if the expression `asio::require(std::declval(), std::declval()...)` is well formed; otherwise `false_type`. @@ -78374,7 +78725,8 @@ A type trait that determines whether a `require_concept` expression is well-form template< typename T, typename Property> - struct can_require_concept + struct can_require_concept : + public integral_constant< bool, automatically_determined > Class template `can_require_concept` is a trait that is derived from `true_type` if the expression `asio::require_concept(std::declval(), std::declval())` is well formed; otherwise `false_type`. @@ -78615,7 +78967,7 @@ Installs a handler into the slot. template< typename ``[link asio.reference.CancellationHandler CancellationHandler]``> - decay< CancellationHandler >::type & assign( + decay_t< CancellationHandler > & assign( CancellationHandler && handler); @@ -78623,7 +78975,7 @@ Destroys any existing handler in the slot, then installs the new handler, constr The handler is a function object to be called when the signal is emitted. The signature of the handler must be - void handler(asio::cancellation_type_t); + void handler(asio::cancellation_type_t); @@ -78697,7 +79049,7 @@ Destroys any existing handler in the slot, then installs the new handler, constr The handler is a function object to be called when the signal is emitted. The signature of the handler must be - void handler(asio::cancellation_type_t); + void handler(asio::cancellation_type_t); @@ -78763,7 +79115,7 @@ Returns whether the slot is connected to a signal. Compare two slots for inequality. - friend constexpr bool operator!=( + constexpr bool operator!=( const cancellation_slot & lhs, const cancellation_slot & rhs); @@ -78785,7 +79137,7 @@ Compare two slots for inequality. Compare two slots for equality. - friend constexpr bool operator==( + constexpr bool operator==( const cancellation_slot & lhs, const cancellation_slot & rhs); @@ -78902,7 +79254,7 @@ A call wrapper type to bind a cancellation slot of type `CancellationSlot` to an [ [[link asio.reference.cancellation_slot_binder.operator_lp__rp_ [*operator()]]] - [] + [Forwarding function call operator. ] ] [ @@ -79321,28 +79673,32 @@ Obtain the associated cancellation slot. [section:operator_lp__rp_ cancellation_slot_binder::operator()] [indexterm2 asio.indexterm.cancellation_slot_binder.operator_lp__rp_..operator()..cancellation_slot_binder] +Forwarding function call operator. + template< typename... Args> - auto ``[link asio.reference.cancellation_slot_binder.operator_lp__rp_.overload1 operator()]``( - Args && ...); + result_of_t< T(Args...)> ``[link asio.reference.cancellation_slot_binder.operator_lp__rp_.overload1 operator()]``( + Args &&... args); `` [''''»''' [link asio.reference.cancellation_slot_binder.operator_lp__rp_.overload1 more...]]`` template< typename... Args> - auto ``[link asio.reference.cancellation_slot_binder.operator_lp__rp_.overload2 operator()]``( - Args && ...) const; + result_of_t< T(Args...)> ``[link asio.reference.cancellation_slot_binder.operator_lp__rp_.overload2 operator()]``( + Args &&... args) const; `` [''''»''' [link asio.reference.cancellation_slot_binder.operator_lp__rp_.overload2 more...]]`` [section:overload1 cancellation_slot_binder::operator() (1 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...); + result_of_t< T(Args...)> operator()( + Args &&... args); @@ -79353,11 +79709,13 @@ Obtain the associated cancellation slot. [section:overload2 cancellation_slot_binder::operator() (2 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...) const; + result_of_t< T(Args...)> operator()( + Args &&... args) const; @@ -79581,7 +79939,8 @@ Construct and attach to a parent slot to create a new child slot. CancellationSlot slot); -Initialises the cancellation state so that it allows terminal cancellation only. Equivalent to `cancellation_state(slot, enable_terminal_cancellation())`. +Initialises the cancellation state so that it allows terminal cancellation only. Equivalent to `cancellation_state(slot, +enable_terminal_cancellation())`. [heading Parameters] @@ -79624,8 +79983,8 @@ Construct and attach to a parent slot to create a new child slot. [[filter][A function object that is used to transform incoming cancellation signals as they are received from the parent slot. This function object must have the signature: `` - asio::cancellation_type_t filter( - asio::cancellation_type_t); + asio::cancellation_type_t filter( + asio::cancellation_type_t); `` ]] @@ -79675,15 +80034,15 @@ Construct and attach to a parent slot to create a new child slot. [[in_filter][A function object that is used to transform incoming cancellation signals as they are received from the parent slot. This function object must have the signature: `` - asio::cancellation_type_t in_filter( - asio::cancellation_type_t); + asio::cancellation_type_t in_filter( + asio::cancellation_type_t); `` ]] [[out_filter][A function object that is used to transform outcoming cancellation signals as they are relayed to the child slot. This function object must have the signature: `` - asio::cancellation_type_t out_filter( - asio::cancellation_type_t); + asio::cancellation_type_t out_filter( + asio::cancellation_type_t); `` ]] @@ -79849,7 +80208,7 @@ Spawn a new coroutined-based thread of execution. const Executor & ex, awaitable< T, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type = 0); + constraint_t<(is_executor< Executor >::value||execution::is_executor< Executor >::value) &&is_convertible< Executor, AwaitableExecutor >::value > = 0); `` [''''»''' [link asio.reference.co_spawn.overload1 more...]]`` template< @@ -79860,7 +80219,7 @@ Spawn a new coroutined-based thread of execution. const Executor & ex, awaitable< void, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type = 0); + constraint_t<(is_executor< Executor >::value||execution::is_executor< Executor >::value) &&is_convertible< Executor, AwaitableExecutor >::value > = 0); `` [''''»''' [link asio.reference.co_spawn.overload2 more...]]`` template< @@ -79872,7 +80231,7 @@ Spawn a new coroutined-based thread of execution. ExecutionContext & ctx, awaitable< T, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value > = 0); `` [''''»''' [link asio.reference.co_spawn.overload3 more...]]`` template< @@ -79883,7 +80242,7 @@ Spawn a new coroutined-based thread of execution. ExecutionContext & ctx, awaitable< void, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value > = 0); `` [''''»''' [link asio.reference.co_spawn.overload4 more...]]`` template< @@ -79894,7 +80253,7 @@ Spawn a new coroutined-based thread of execution. const Executor & ex, F && f, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.co_spawn.overload5 more...]]`` template< @@ -79905,12 +80264,12 @@ Spawn a new coroutined-based thread of execution. ExecutionContext & ctx, F && f, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.co_spawn.overload6 more...]]`` [heading Requirements] -['Header: ][^asio/co_spawn.hpp] +['Header: ][^asio/impl/co_spawn.hpp] ['Convenience header: ][^asio.hpp] @@ -79930,7 +80289,7 @@ Spawn a new coroutined-based thread of execution. const Executor & ex, awaitable< T, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type = 0); + constraint_t<(is_executor< Executor >::value||execution::is_executor< Executor >::value) &&is_convertible< Executor, AwaitableExecutor >::value > = 0); @@ -79945,7 +80304,7 @@ Spawn a new coroutined-based thread of execution. [[token][The [link asio.overview.model.completion_tokens 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); + void handler(std::exception_ptr, T); `` ]] @@ -79956,7 +80315,7 @@ Spawn a new coroutined-based thread of execution. - void(std::exception_ptr, T) + void(std::exception_ptr, T) @@ -79966,39 +80325,39 @@ Spawn a new coroutined-based thread of execution. - asio::awaitable echo(tcp::socket socket) - { - std::size_t bytes_transferred = 0; + 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); + 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); + co_await asio::async_write(socket, + asio::buffer(data, n), asio::use_awaitable); - bytes_transferred += n; - } - } - catch (const std::exception&) - { - } + bytes_transferred += n; + } + } + catch (const std::exception&) + { + } - co_return bytes_transferred; - } + 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"; - }); + asio::co_spawn(my_executor, + echo(std::move(my_tcp_socket)), + [](std::exception_ptr e, std::size_t n) + { + std::cout << "transferred " << n << "\n"; + }); @@ -80029,7 +80388,7 @@ Spawn a new coroutined-based thread of execution. const Executor & ex, awaitable< void, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type = 0); + constraint_t<(is_executor< Executor >::value||execution::is_executor< Executor >::value) &&is_convertible< Executor, AwaitableExecutor >::value > = 0); @@ -80044,7 +80403,7 @@ Spawn a new coroutined-based thread of execution. [[token][The [link asio.overview.model.completion_tokens 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); + void handler(std::exception_ptr); `` ]] @@ -80055,7 +80414,7 @@ Spawn a new coroutined-based thread of execution. - void(std::exception_ptr) + void(std::exception_ptr) @@ -80065,31 +80424,31 @@ Spawn a new coroutined-based thread of execution. - 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); + 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"; - } - } + 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); + asio::co_spawn(my_executor, + echo(std::move(my_tcp_socket)), + asio::detached); @@ -80121,7 +80480,7 @@ Spawn a new coroutined-based thread of execution. ExecutionContext & ctx, awaitable< T, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value > = 0); @@ -80136,7 +80495,7 @@ Spawn a new coroutined-based thread of execution. [[token][The [link asio.overview.model.completion_tokens 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); + void handler(std::exception_ptr); `` ]] @@ -80147,7 +80506,7 @@ Spawn a new coroutined-based thread of execution. - void(std::exception_ptr, T) + void(std::exception_ptr, T) @@ -80157,39 +80516,39 @@ Spawn a new coroutined-based thread of execution. - asio::awaitable echo(tcp::socket socket) - { - std::size_t bytes_transferred = 0; + 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); + 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); + co_await asio::async_write(socket, + asio::buffer(data, n), asio::use_awaitable); - bytes_transferred += n; - } - } - catch (const std::exception&) - { - } + bytes_transferred += n; + } + } + catch (const std::exception&) + { + } - co_return bytes_transferred; - } + 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"; - }); + 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"; + }); @@ -80220,7 +80579,7 @@ Spawn a new coroutined-based thread of execution. ExecutionContext & ctx, awaitable< void, AwaitableExecutor > a, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value > = 0); @@ -80235,7 +80594,7 @@ Spawn a new coroutined-based thread of execution. [[token][The [link asio.overview.model.completion_tokens 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); + void handler(std::exception_ptr); `` ]] @@ -80246,7 +80605,7 @@ Spawn a new coroutined-based thread of execution. - void(std::exception_ptr) + void(std::exception_ptr) @@ -80256,31 +80615,31 @@ Spawn a new coroutined-based thread of execution. - 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); + 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"; - } - } + 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); + asio::co_spawn(my_io_context, + echo(std::move(my_tcp_socket)), + asio::detached); @@ -80311,7 +80670,7 @@ Spawn a new coroutined-based thread of execution. const Executor & ex, F && f, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -80330,12 +80689,12 @@ Spawn a new coroutined-based thread of execution. - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -80345,12 +80704,12 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the first template argument to the `awaitable` returned by the supplied function object `F:` - asio::awaitable F() + asio::awaitable F() @@ -80360,54 +80719,54 @@ where `R` is the first template argument to the `awaitable` returned by the supp - asio::awaitable echo(tcp::socket socket) - { - std::size_t bytes_transferred = 0; + 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); + 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); + co_await asio::async_write(socket, + asio::buffer(data, n), asio::use_awaitable); - bytes_transferred += n; - } - } - catch (const std::exception&) - { - } + bytes_transferred += n; + } + } + catch (const std::exception&) + { + } - co_return bytes_transferred; - } + 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); + 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); + 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); @@ -80438,7 +80797,7 @@ Spawn a new coroutined-based thread of execution. ExecutionContext & ctx, F && f, CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -80457,12 +80816,12 @@ Spawn a new coroutined-based thread of execution. - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -80472,12 +80831,12 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the first template argument to the `awaitable` returned by the supplied function object `F:` - asio::awaitable F() + asio::awaitable F() @@ -80487,54 +80846,54 @@ where `R` is the first template argument to the `awaitable` returned by the supp - asio::awaitable echo(tcp::socket socket) - { - std::size_t bytes_transferred = 0; + 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); + 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); + co_await asio::async_write(socket, + asio::buffer(data, n), asio::use_awaitable); - bytes_transferred += n; - } - } - catch (const std::exception&) - { - } + bytes_transferred += n; + } + } + catch (const std::exception&) + { + } - co_return bytes_transferred; - } + 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); + 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); + 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); @@ -80609,6 +80968,41 @@ Class template `completion_signature_of` is a trait with a member type alias `ty [endsect] + +[section:completion_signature_of_t completion_signature_of_t] + +[indexterm1 asio.indexterm.completion_signature_of_t..completion_signature_of_t] + + + typedef typename completion_signature_of< T, Args... >::type completion_signature_of_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.completion_signature_of.type [*type]]] + [] + + ] + +] + +Class template `completion_signature_of` is a trait with a member type alias `type` that denotes the completion signature of the asynchronous operation initiated by the expression `T(Args..., token)` operation, where `token` is an unspecified completion token type. If the asynchronous operation does not have exactly one completion signature, the instantion of the trait is well-formed but the member type alias `type` is omitted. If the expression `T(Args..., token)` is not an asynchronous operation then use of the trait is ill-formed. + + +[heading Requirements] + +['Header: ][^asio/async_result.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:connect connect] [indexterm1 asio.indexterm.connect..connect] @@ -80625,7 +81019,7 @@ Establishes a socket connection by trying each endpoint in a sequence. Protocol::endpoint ``[link asio.reference.connect.overload1 connect]``( basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 0); `` [''''»''' [link asio.reference.connect.overload1 more...]]`` template< @@ -80636,7 +81030,7 @@ Establishes a socket connection by trying each endpoint in a sequence. basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, asio::error_code & ec, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 0); `` [''''»''' [link asio.reference.connect.overload2 more...]]`` (Deprecated: Use range overload.) Establishes a socket connection by trying each endpoint in a sequence. @@ -80648,7 +81042,7 @@ Establishes a socket connection by trying each endpoint in a sequence. Iterator ``[link asio.reference.connect.overload3 connect]``( basic_socket< Protocol, Executor > & s, Iterator begin, - typename constraint::value >::type = 0); + constraint_t::value > = 0); `` [''''»''' [link asio.reference.connect.overload3 more...]]`` template< @@ -80659,7 +81053,7 @@ Establishes a socket connection by trying each endpoint in a sequence. basic_socket< Protocol, Executor > & s, Iterator begin, asio::error_code & ec, - typename constraint::value >::type = 0); + constraint_t::value > = 0); `` [''''»''' [link asio.reference.connect.overload4 more...]]`` Establishes a socket connection by trying each endpoint in a sequence. @@ -80694,7 +81088,7 @@ Establishes a socket connection by trying each endpoint in a sequence. basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, ConnectCondition connect_condition, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 0); `` [''''»''' [link asio.reference.connect.overload7 more...]]`` template< @@ -80707,7 +81101,7 @@ Establishes a socket connection by trying each endpoint in a sequence. const EndpointSequence & endpoints, ConnectCondition connect_condition, asio::error_code & ec, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 0); `` [''''»''' [link asio.reference.connect.overload8 more...]]`` (Deprecated: Use range overload.) Establishes a socket connection by trying each endpoint in a sequence. @@ -80721,7 +81115,7 @@ Establishes a socket connection by trying each endpoint in a sequence. basic_socket< Protocol, Executor > & s, Iterator begin, ConnectCondition connect_condition, - typename constraint::value >::type = 0); + constraint_t::value > = 0); `` [''''»''' [link asio.reference.connect.overload9 more...]]`` template< @@ -80734,7 +81128,7 @@ Establishes a socket connection by trying each endpoint in a sequence. Iterator begin, ConnectCondition connect_condition, asio::error_code & ec, - typename constraint::value >::type = 0); + constraint_t::value > = 0); `` [''''»''' [link asio.reference.connect.overload10 more...]]`` Establishes a socket connection by trying each endpoint in a sequence. @@ -80766,7 +81160,7 @@ Establishes a socket connection by trying each endpoint in a sequence. [heading Requirements] -['Header: ][^asio/connect.hpp] +['Header: ][^asio/impl/connect.hpp] ['Convenience header: ][^asio.hpp] @@ -80784,7 +81178,7 @@ Establishes a socket connection by trying each endpoint in a sequence. Protocol::endpoint connect( basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 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. @@ -80822,9 +81216,9 @@ The successfully connected endpoint. tcp::resolver r(my_context); - tcp::resolver::query q("host", "service"); - tcp::socket s(my_context); - asio::connect(s, r.resolve(q)); + tcp::resolver::query q("host", "service"); + tcp::socket s(my_context); + asio::connect(s, r.resolve(q)); @@ -80850,7 +81244,7 @@ Establishes a socket connection by trying each endpoint in a sequence. basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, asio::error_code & ec, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 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. @@ -80880,14 +81274,14 @@ On success, the successfully connected endpoint. Otherwise, a default-constructe 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. - } + 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. + } @@ -80912,7 +81306,7 @@ On success, the successfully connected endpoint. Otherwise, a default-constructe Iterator connect( basic_socket< Protocol, Executor > & s, Iterator begin, - typename constraint::value >::type = 0); + constraint_t::value > = 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. @@ -80970,7 +81364,7 @@ This overload assumes that a default constructed object of type `Iterator` repre basic_socket< Protocol, Executor > & s, Iterator begin, asio::error_code & ec, - typename constraint::value >::type = 0); + constraint_t::value > = 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. @@ -81059,10 +81453,10 @@ An iterator denoting the successfully connected endpoint. 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()); + 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()); @@ -81120,15 +81514,15 @@ On success, an iterator denoting the successfully connected endpoint. Otherwise, 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. - } + 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. + } @@ -81155,7 +81549,7 @@ Establishes a socket connection by trying each endpoint in a sequence. basic_socket< Protocol, Executor > & s, const EndpointSequence & endpoints, ConnectCondition connect_condition, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 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. @@ -81172,9 +81566,9 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] @@ -81201,26 +81595,26 @@ The successfully connected endpoint. 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; - } - }; + { + 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: +It would be used with the [link asio.reference.connect `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; + 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; @@ -81248,7 +81642,7 @@ Establishes a socket connection by trying each endpoint in a sequence. const EndpointSequence & endpoints, ConnectCondition connect_condition, asio::error_code & ec, - typename constraint< is_endpoint_sequence< EndpointSequence >::value >::type = 0); + constraint_t< is_endpoint_sequence< EndpointSequence >::value > = 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. @@ -81265,9 +81659,9 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] @@ -81286,34 +81680,34 @@ On success, the successfully connected endpoint. Otherwise, a default-constructe 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; - } - }; + { + 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: +It would be used with the [link asio.reference.connect `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; - } + 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; + } @@ -81340,7 +81734,7 @@ It would be used with the `asio::connect` function as follows: basic_socket< Protocol, Executor > & s, Iterator begin, ConnectCondition connect_condition, - typename constraint::value >::type = 0); + constraint_t::value > = 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. @@ -81357,9 +81751,9 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] @@ -81408,7 +81802,7 @@ This overload assumes that a default constructed object of type `Iterator` repre Iterator begin, ConnectCondition connect_condition, asio::error_code & ec, - typename constraint::value >::type = 0); + constraint_t::value > = 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. @@ -81425,9 +81819,9 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] @@ -81486,9 +81880,9 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] @@ -81515,27 +81909,27 @@ An iterator denoting the successfully connected endpoint. 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; - } - }; + { + 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: +It would be used with the [link asio.reference.connect `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; + 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; @@ -81582,9 +81976,9 @@ This function attempts to connect a socket to one of a sequence of endpoints. It [[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); + 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.]] @@ -81603,35 +81997,35 @@ On success, an iterator denoting the successfully connected endpoint. Otherwise, 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; - } - }; + { + 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: +It would be used with the [link asio.reference.connect `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; - } + 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; + } @@ -81783,7 +82177,7 @@ Completion token adapter used to specify that the completion handler should carr template< typename CompletionToken, typename... Values> - constexpr consign_t< typename decay< CompletionToken >::type, typename decay< Values >::type...> consign( + constexpr consign_t< decay_t< CompletionToken >, decay_t< Values >... > consign( CompletionToken && completion_token, Values &&... values); @@ -81919,8 +82313,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::const_buffer b1 = ...; - std::size_t s1 = b1.size(); - const unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + const unsigned char* p1 = static_cast(b1.data()); @@ -82461,8 +82855,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::const_buffer b1 = ...; - std::size_t s1 = b1.size(); - const unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + const unsigned char* p1 = static_cast(b1.data()); @@ -82787,9 +83181,9 @@ Coroutines are copy-constructible and assignable, and the space overhead is a si class session : coroutine - { - ... - }; + { + ... + }; @@ -82799,10 +83193,10 @@ or as a data member: class session - { - ... - coroutine coro_; - }; + { + ... + coroutine coro_; + }; @@ -82818,7 +83212,7 @@ A coroutine is used in conjunction with certain "pseudo-keywords", which are imp - #include + #include @@ -82827,7 +83221,7 @@ and may conversely be undefined as follows: - #include + #include @@ -82839,9 +83233,9 @@ The `reenter` macro is used to define the body of a coroutine. It takes a single reenter (this) - { - ... coroutine body ... - } + { + ... coroutine body ... + } @@ -82851,9 +83245,9 @@ and if a data member or other variable you can write: reenter (coro_) - { - ... coroutine body ... - } + { + ... coroutine body ... + } @@ -82865,9 +83259,9 @@ The coroutine body may also be a single statement, such as: reenter (this) for (;;) - { - ... - } + { + ... + } @@ -82880,7 +83274,7 @@ This form of the `yield` keyword is often used with asynchronous operations: - yield socket_->async_read_some(buffer(*buffer_), *this); + yield socket_->async_read_some(buffer(*buffer_), *this); @@ -82903,10 +83297,10 @@ The statement may also be a compound statement, and this permits us to define lo yield - { - mutable_buffers_1 b = buffer(*buffer_); - socket_->async_read_some(b, *this); - } + { + mutable_buffers_1 b = buffer(*buffer_); + socket_->async_read_some(b, *this); + } @@ -82918,18 +83312,18 @@ This form of `yield` is often used in generators or coroutine-based parsers. For struct interleave : coroutine - { - istream& is1; - istream& is2; - char operator()(char c) - { - reenter (this) for (;;) - { - yield return is1.get(); - yield return is2.get(); - } - } - }; + { + istream& is1; + istream& is2; + char operator()(char c) + { + reenter (this) for (;;) + { + yield return is1.get(); + yield return is2.get(); + } + } + }; @@ -82961,30 +83355,30 @@ This form might be applied when coroutines are used for cooperative threading an struct task : coroutine - { - ... - void operator()() - { - reenter (this) - { - while (... not finished ...) - { - ... do something ... - yield; - ... do some more ... - yield; - } - } - } - ... - }; - ... - task t1, t2; - for (;;) - { - t1(); - t2(); - } + { + ... + void operator()() + { + reenter (this) + { + while (... not finished ...) + { + ... do something ... + yield; + ... do some more ... + yield; + } + } + } + ... + }; + ... + task t1, t2; + for (;;) + { + t1(); + t2(); + } @@ -83009,15 +83403,15 @@ The `fork` pseudo-keyword is used when "forking" a coroutine, i.e. splitting it 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 ... - } + { + do + { + socket_.reset(new tcp::socket(my_context_)); + yield acceptor->async_accept(*socket_, *this); + fork server(*this)(); + } while (is_parent()); + ... client-specific handling follows ... + } @@ -83254,14 +83648,14 @@ Most applications will use the [link asio.reference.deadline_timer `deadline_tim Performing a blocking wait: - // Construct a timer without setting an expiry time. - asio::deadline_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_from_now(boost::posix_time::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -83269,22 +83663,22 @@ Performing a blocking wait: Performing an asynchronous wait: - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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")); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -83298,26 +83692,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -83401,6 +83795,43 @@ If `T` has a nested type `default_completion_token_type`, `T::default_completion [endsect] + +[section:default_completion_token_t default_completion_token_t] + +[indexterm1 asio.indexterm.default_completion_token_t..default_completion_token_t] + + + typedef typename default_completion_token< T >::type default_completion_token_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.default_completion_token.type [*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. + + +[heading Requirements] + +['Header: ][^asio/async_result.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:defer defer] [indexterm1 asio.indexterm.defer..defer] @@ -83409,26 +83840,26 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.NullaryToken NullaryToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.defer.overload1 defer]``( + auto ``[link asio.reference.defer.overload1 defer]``( NullaryToken && token); `` [''''»''' [link asio.reference.defer.overload1 more...]]`` template< typename ``[link asio.reference.Executor1 Executor]``, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.defer.overload2 defer]``( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link asio.reference.defer.overload2 defer]``( const Executor & ex, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.defer.overload2 more...]]`` template< typename ExecutionContext, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.defer.overload3 defer]``( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link asio.reference.defer.overload3 defer]``( ExecutionContext & ctx, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.defer.overload3 more...]]`` [heading Requirements] @@ -83446,7 +83877,7 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.NullaryToken NullaryToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` defer( + auto defer( NullaryToken && token); @@ -83462,7 +83893,7 @@ The use of `defer()`, rather than [link asio.reference.post `post`], indicates t [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -83476,11 +83907,11 @@ This function returns `async_initiate(Init{}, token)`, whe class Init - { - public: - template - void operator()(CompletionHandler&& completion_handler) const; - }; + { + public: + template + void operator()(CompletionHandler&& completion_handler) const; + }; @@ -83488,9 +83919,9 @@ This function returns `async_initiate(Init{}, token)`, whe The function call operator of `Init:` -* Obtains the handler's associated executor object `ex` of type `Ex` by performing +* Obtains the handler's associated executor object `ex` of type `Ex` by performing - auto ex = get_associated_executor(handler); + auto ex = get_associated_executor(handler); @@ -83498,7 +83929,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(handler); @@ -83506,11 +83937,11 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, performs - prefer( - require(ex, execution::blocking.never), - execution::relationship.continuation, - execution::allocator(alloc) - ).execute(std::forward(completion_handler)); + prefer( + require(ex, execution::blocking.never), + execution::relationship.continuation, + execution::allocator(alloc) + ).execute(std::forward(completion_handler)); @@ -83518,9 +83949,9 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, performs - ex.defer( - std::forward(completion_handler), - alloc); + ex.defer( + std::forward(completion_handler), + alloc); @@ -83530,7 +83961,7 @@ The function call operator of `Init:` - void() + void() @@ -83550,11 +83981,11 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.Executor1 Executor]``, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` defer( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto defer( const Executor & ex, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 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()`. @@ -83571,7 +84002,7 @@ The use of `defer()`, rather than [link asio.reference.post `post`], indicates t [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -83585,16 +84016,16 @@ This function returns `async_initiate(Init{ex}, token)`, w class Init - { - public: - using executor_type = Executor; - explicit Init(const Executor& ex) : ex_(ex) {} - executor_type get_executor() const noexcept { return ex_; } - template - void operator()(CompletionHandler&& completion_handler) const; - private: - Executor ex_; // exposition only - }; + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler) const; + private: + Executor ex_; // exposition only + }; @@ -83602,9 +84033,9 @@ This function returns `async_initiate(Init{ex}, token)`, w The function call operator of `Init:` -* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing - auto ex1 = get_associated_executor(handler, ex); + auto ex1 = get_associated_executor(handler, ex); @@ -83612,7 +84043,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(handler); @@ -83621,7 +84052,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, constructs a function object `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: auto a = get_associated_allocator(handler_); - prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); @@ -83630,8 +84061,8 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, constructs a function object `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: auto a = get_associated_allocator(handler_); - work_.get_executor().dispatch(std::move(handler_), a); - work_.reset(); + work_.get_executor().dispatch(std::move(handler_), a); + work_.reset(); @@ -83639,11 +84070,11 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, performs - prefer( - require(ex, execution::blocking.never), - execution::relationship.continuation, - execution::allocator(alloc) - ).execute(std::move(f)); + prefer( + require(ex, execution::blocking.never), + execution::relationship.continuation, + execution::allocator(alloc) + ).execute(std::move(f)); @@ -83651,7 +84082,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, performs - ex.defer(std::move(f), alloc); + ex.defer(std::move(f), alloc); @@ -83661,7 +84092,7 @@ The function call operator of `Init:` - void() + void() @@ -83681,11 +84112,11 @@ Submits a completion token or function object for execution. template< typename ExecutionContext, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` defer( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto defer( ExecutionContext & ctx, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -83698,7 +84129,7 @@ Submits a completion token or function object for execution. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -83714,7 +84145,7 @@ Submits a completion token or function object for execution. - void() + void() @@ -83774,14 +84205,11 @@ Encapsulates a deferred asynchronous operation. [Construct a deferred asynchronous operation from the arguments to an initiation function object. ] ] - [ - [[link asio.reference.deferred_async_operation.detail__index_sequence_for [*detail::index_sequence_for]]] - [] - ] - [ [[link asio.reference.deferred_async_operation.operator_lp__rp_ [*operator()]]] - [Initiate the asynchronous operation using the supplied completion token. ] + [Initiate the asynchronous operation using the supplied completion token. + [hr] + ] ] ] @@ -83812,22 +84240,30 @@ Construct a deferred asynchronous operation from the arguments to an initiation [endsect] +[section:operator_lp__rp_ deferred_async_operation::operator()] -[section:detail__index_sequence_for deferred_async_operation::detail::index_sequence_for] +[indexterm2 asio.indexterm.deferred_async_operation.operator_lp__rp_..operator()..deferred_async_operation] +Initiate the asynchronous operation using the supplied completion token. -[indexterm2 asio.indexterm.deferred_async_operation.detail__index_sequence_for..detail::index_sequence_for..deferred_async_operation] - auto detail::index_sequence_for(); + template< + typename CompletionToken> + auto ``[link asio.reference.deferred_async_operation.operator_lp__rp_.overload1 operator()]``( + CompletionToken && token); + `` [''''»''' [link asio.reference.deferred_async_operation.operator_lp__rp_.overload1 more...]]`` -[endsect] + template< + typename CompletionToken> + auto ``[link asio.reference.deferred_async_operation.operator_lp__rp_.overload2 operator()]``( + CompletionToken && token) const; + `` [''''»''' [link asio.reference.deferred_async_operation.operator_lp__rp_.overload2 more...]]`` +[section:overload1 deferred_async_operation::operator() (1 of 2 overloads)] -[section:operator_lp__rp_ deferred_async_operation::operator()] -[indexterm2 asio.indexterm.deferred_async_operation.operator_lp__rp_..operator()..deferred_async_operation] Initiate the asynchronous operation using the supplied completion token. @@ -83842,11 +84278,28 @@ Initiate the asynchronous operation using the supplied completion token. +[section:overload2 deferred_async_operation::operator() (2 of 2 overloads)] + + + + template< + typename CompletionToken> + auto operator()( + CompletionToken && token) const; + + + +[endsect] + + +[endsect] + + [endsect] -[section:deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_ deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>] +[section:deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_ deferred_async_operation< deferred_signatures< Signatures... >, Initiation, InitArgs... >] -[indexterm1 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] +[indexterm1 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_..deferred_async_operation< deferred_signatures< Signatures\.\.\. >, Initiation, InitArgs\.\.\. >] Encapsulates a deferred asynchronous operation thas has multiple completion signatures. @@ -83856,7 +84309,7 @@ Encapsulates a deferred asynchronous operation thas has multiple completion sign typename... Signatures, typename Initiation, typename... InitArgs> - class deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...> + class deferred_async_operation< deferred_signatures< Signatures... >, Initiation, InitArgs... > [heading Member Functions] @@ -83864,18 +84317,15 @@ Encapsulates a deferred asynchronous operation thas has multiple completion sign [[Name][Description]] [ - [[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.deferred_async_operation [*deferred_async_operation]]] + [[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.deferred_async_operation [*deferred_async_operation]]] [Construct a deferred asynchronous operation from the arguments to an initiation function object. ] ] [ - [[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.detail__index_sequence_for [*detail::index_sequence_for]]] - [] - ] - - [ - [[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.operator_lp__rp_ [*operator()]]] - [Initiate the asynchronous operation using the supplied completion token. ] + [[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.operator_lp__rp_ [*operator()]]] + [Initiate the asynchronous operation using the supplied completion token. + [hr] + ] ] ] @@ -83887,9 +84337,9 @@ Encapsulates a deferred asynchronous operation thas has multiple completion sign ['Convenience header: ][^asio.hpp] -[section:deferred_async_operation deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>::deferred_async_operation] +[section:deferred_async_operation deferred_async_operation< deferred_signatures< Signatures... >, Initiation, InitArgs... >::deferred_async_operation] -[indexterm2 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.deferred_async_operation..deferred_async_operation..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] +[indexterm2 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.deferred_async_operation..deferred_async_operation..deferred_async_operation< deferred_signatures< Signatures\.\.\. >, Initiation, InitArgs\.\.\. >] Construct a deferred asynchronous operation from the arguments to an initiation function object. @@ -83906,22 +84356,30 @@ Construct a deferred asynchronous operation from the arguments to an initiation [endsect] +[section:operator_lp__rp_ deferred_async_operation< deferred_signatures< Signatures... >, Initiation, InitArgs... >::operator()] -[section:detail__index_sequence_for deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>::detail::index_sequence_for] +[indexterm2 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.operator_lp__rp_..operator()..deferred_async_operation< deferred_signatures< Signatures\.\.\. >, Initiation, InitArgs\.\.\. >] +Initiate the asynchronous operation using the supplied completion token. -[indexterm2 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.detail__index_sequence_for..detail::index_sequence_for..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] - auto detail::index_sequence_for(); + template< + typename CompletionToken> + auto ``[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.operator_lp__rp_.overload1 operator()]``( + CompletionToken && token); + `` [''''»''' [link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.operator_lp__rp_.overload1 more...]]`` -[endsect] + template< + typename CompletionToken> + auto ``[link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.operator_lp__rp_.overload2 operator()]``( + CompletionToken && token) const; + `` [''''»''' [link asio.reference.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.operator_lp__rp_.overload2 more...]]`` +[section:overload1 deferred_async_operation< deferred_signatures< Signatures... >, Initiation, InitArgs... >::operator() (1 of 2 overloads)] -[section:operator_lp__rp_ deferred_async_operation< deferred_signatures< Signatures...>, Initiation, InitArgs...>::operator()] -[indexterm2 asio.indexterm.deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.operator_lp__rp_..operator()..deferred_async_operation< deferred_signatures< Signatures\.\.\.>, Initiation, InitArgs\.\.\.>] Initiate the asynchronous operation using the supplied completion token. @@ -83936,6 +84394,23 @@ Initiate the asynchronous operation using the supplied completion token. +[section:overload2 deferred_async_operation< deferred_signatures< Signatures... >, Initiation, InitArgs... >::operator() (2 of 2 overloads)] + + + + template< + typename CompletionToken> + auto operator()( + CompletionToken && token) const; + + + +[endsect] + + +[endsect] + + [endsect] [section:deferred_conditional deferred_conditional] @@ -83963,7 +84438,9 @@ Used to represent a deferred conditional branch. [ [[link asio.reference.deferred_conditional.operator_lp__rp_ [*operator()]]] - [Invoke the conditional branch bsaed on the stored alue. ] + [Invoke the conditional branch bsaed on the stored value. + [hr] + ] ] [ @@ -83999,11 +84476,31 @@ Construct a deferred conditional with the value to determine which branch will b [endsect] - [section:operator_lp__rp_ deferred_conditional::operator()] [indexterm2 asio.indexterm.deferred_conditional.operator_lp__rp_..operator()..deferred_conditional] -Invoke the conditional branch bsaed on the stored alue. +Invoke the conditional branch bsaed on the stored value. + + + template< + typename... Args> + auto ``[link asio.reference.deferred_conditional.operator_lp__rp_.overload1 operator()]``( + Args &&... args); + `` [''''»''' [link asio.reference.deferred_conditional.operator_lp__rp_.overload1 more...]]`` + + + + template< + typename... Args> + auto ``[link asio.reference.deferred_conditional.operator_lp__rp_.overload2 operator()]``( + Args &&... args) const; + `` [''''»''' [link asio.reference.deferred_conditional.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 deferred_conditional::operator() (1 of 2 overloads)] + + +Invoke the conditional branch bsaed on the stored value. template< @@ -84017,6 +84514,23 @@ Invoke the conditional branch bsaed on the stored alue. +[section:overload2 deferred_conditional::operator() (2 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args &&... args) const; + + + +[endsect] + + +[endsect] + + [section:otherwise deferred_conditional::otherwise] [indexterm2 asio.indexterm.deferred_conditional.otherwise..otherwise..deferred_conditional] @@ -84027,9 +84541,9 @@ Set the false branch of the conditional. typename T> deferred_conditional< OnTrue, T > otherwise( T on_false, - typename constraint< is_deferred< T >::value >::type * = 0, - typename constraint< !is_same< typename conditional< true, OnTrue, T >::type, deferred_noop >::value >::type * = 0, - typename constraint< is_same< typename conditional< true, OnFalse, T >::type, deferred_noop >::value >::type * = 0); + constraint_t< is_deferred< T >::value > * = 0, + constraint_t< !is_same< conditional_t< true, OnTrue, T >, deferred_noop >::value > * = 0, + constraint_t< is_same< conditional_t< true, OnFalse, T >, deferred_noop >::value > * = 0); @@ -84047,8 +84561,8 @@ Set the true branch of the conditional. typename T> deferred_conditional< T, OnFalse > then( T on_true, - typename constraint< is_deferred< T >::value >::type * = 0, - typename constraint< is_same< typename conditional< true, OnTrue, T >::type, deferred_noop >::value >::type * = 0); + constraint_t< is_deferred< T >::value > * = 0, + constraint_t< is_same< conditional_t< true, OnTrue, T >, deferred_noop >::value > * = 0); @@ -84134,11 +84648,27 @@ Constructor. [endsect] - [section:operator_lp__rp_ deferred_function::operator()] [indexterm2 asio.indexterm.deferred_function.operator_lp__rp_..operator()..deferred_function] + template< + typename... Args> + auto ``[link asio.reference.deferred_function.operator_lp__rp_.overload1 operator()]``( + Args &&... args); + `` [''''»''' [link asio.reference.deferred_function.operator_lp__rp_.overload1 more...]]`` + + template< + typename... Args> + auto ``[link asio.reference.deferred_function.operator_lp__rp_.overload2 operator()]``( + Args &&... args) const; + `` [''''»''' [link asio.reference.deferred_function.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 deferred_function::operator() (1 of 2 overloads)] + + + template< typename... Args> auto operator()( @@ -84150,6 +84680,23 @@ Constructor. +[section:overload2 deferred_function::operator() (2 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args &&... args) const; + + + +[endsect] + + +[endsect] + + [endsect] [section:deferred_init_tag deferred_init_tag] @@ -84200,10 +84747,28 @@ Used to represent an empty deferred action. ['Convenience header: ][^asio.hpp] - [section:operator_lp__rp_ deferred_noop::operator()] [indexterm2 asio.indexterm.deferred_noop.operator_lp__rp_..operator()..deferred_noop] +No effect. + + + template< + typename... Args> + void ``[link asio.reference.deferred_noop.operator_lp__rp_.overload1 operator()]``( + Args && ...); + `` [''''»''' [link asio.reference.deferred_noop.operator_lp__rp_.overload1 more...]]`` + + template< + typename... Args> + void ``[link asio.reference.deferred_noop.operator_lp__rp_.overload2 operator()]``( + Args && ...) const; + `` [''''»''' [link asio.reference.deferred_noop.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 deferred_noop::operator() (1 of 2 overloads)] + + No effect. @@ -84218,6 +84783,25 @@ No effect. +[section:overload2 deferred_noop::operator() (2 of 2 overloads)] + + +No effect. + + + template< + typename... Args> + void operator()( + Args && ...) const; + + + +[endsect] + + +[endsect] + + [endsect] [section:deferred_sequence deferred_sequence] @@ -84231,7 +84815,8 @@ Defines a link between two consecutive operations in a sequence. template< typename Head, typename Tail> - class deferred_sequence + class deferred_sequence : + public detail::deferred_sequence_types::base [heading Member Functions] @@ -84362,6 +84947,13 @@ Class used to specify that an asynchronous operation should return a function ob [table [[Name][Description]] + [ + + [[link asio.reference.deferred_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use deferred_t as its default completion token type. ] + + ] + [ [[link asio.reference.deferred_t__executor_with_default [*executor_with_default]]] @@ -84408,9 +85000,9 @@ The [link asio.reference.deferred_t `deferred_t`] class is used to indicate that - auto my_deferred_op - = my_socket.async_read_some(my_buffer, - asio::deferred); + auto my_deferred_op + = my_socket.async_read_some(my_buffer, + asio::deferred); @@ -84432,7 +85024,7 @@ Function helper to adapt an I/O object to use `deferred_t` as its default comple template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -84441,6 +85033,51 @@ Function helper to adapt an I/O object to use `deferred_t` as its default comple +[section:as_default_on_t deferred_t::as_default_on_t] + +[indexterm2 asio.indexterm.deferred_t.as_default_on_t..as_default_on_t..deferred_t] +Type alias to adapt an I/O object to use `deferred_t` as its default completion token type. + + + typedef typename T::template rebind_executor< executor_with_default< typename T::executor_type > >::other as_default_on_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.deferred_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify deferred_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.deferred_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/deferred.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:deferred_t deferred_t::deferred_t] [indexterm2 asio.indexterm.deferred_t.deferred_t..deferred_t..deferred_t] @@ -84462,7 +85099,7 @@ Creates a new deferred from a function. template< typename Function> - constraint< !is_deferred< typename decay< Function >::type >::value, deferred_function< typename decay< Function >::type > >::type ``[link asio.reference.deferred_t.operator_lp__rp_.overload1 operator()]``( + constraint_t< !is_deferred< decay_t< Function > >::value, deferred_function< decay_t< Function > > > ``[link asio.reference.deferred_t.operator_lp__rp_.overload1 operator()]``( Function && function) const; `` [''''»''' [link asio.reference.deferred_t.operator_lp__rp_.overload1 more...]]`` @@ -84472,7 +85109,7 @@ Passes through anything that is already deferred. template< typename T> - constraint< is_deferred< typename decay< T >::type >::value, typename decay< T >::type >::type ``[link asio.reference.deferred_t.operator_lp__rp_.overload2 operator()]``( + constraint_t< is_deferred< decay_t< T > >::value, decay_t< T > > ``[link asio.reference.deferred_t.operator_lp__rp_.overload2 operator()]``( T && t) const; `` [''''»''' [link asio.reference.deferred_t.operator_lp__rp_.overload2 more...]]`` @@ -84485,7 +85122,7 @@ Creates a new deferred from a function. template< typename Function> - constraint< !is_deferred< typename decay< Function >::type >::value, deferred_function< typename decay< Function >::type > >::type operator()( + constraint_t< !is_deferred< decay_t< Function > >::value, deferred_function< decay_t< Function > > > operator()( Function && function) const; @@ -84502,7 +85139,7 @@ Passes through anything that is already deferred. template< typename T> - constraint< is_deferred< typename decay< T >::type >::value, typename decay< T >::type >::type operator()( + constraint_t< is_deferred< decay_t< T > >::value, decay_t< T > > operator()( T && t) const; @@ -84521,7 +85158,7 @@ Returns a deferred operation that returns the provided values. template< typename... Args> - static constexpr deferred_values< typename decay< Args >::type...> values( + static constexpr deferred_values< decay_t< Args >... > values( Args &&... args); @@ -84557,7 +85194,8 @@ Adapts an executor to add the `deferred_t` completion token as the default. template< typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + struct executor_with_default : + public InnerExecutor [heading Types] @@ -84604,6 +85242,13 @@ Specify `deferred_t` as the default completion token type. [table [[Name][Description]] + [ + + [[link asio.reference.deferred_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use deferred_t as its default completion token type. ] + + ] + [ [[link asio.reference.deferred_t__executor_with_default [*executor_with_default]]] @@ -84650,9 +85295,9 @@ The [link asio.reference.deferred_t `deferred_t`] class is used to indicate that - auto my_deferred_op - = my_socket.async_read_some(my_buffer, - asio::deferred); + auto my_deferred_op + = my_socket.async_read_some(my_buffer, + asio::deferred); @@ -84681,7 +85326,7 @@ Construct the adapted executor from the inner executor type. typename ``[link asio.reference.Executor1 InnerExecutor1]``> executor_with_default( const InnerExecutor1 & ex, - typename constraint< conditional< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::type::value >::type = 0); + constraint_t< conditional_t< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::value > = 0); @@ -84713,14 +85358,11 @@ Encapsulates deferred values. [Construct a deferred asynchronous operation from the arguments to an initiation function object. ] ] - [ - [[link asio.reference.deferred_values.detail__index_sequence_for [*detail::index_sequence_for]]] - [] - ] - [ [[link asio.reference.deferred_values.operator_lp__rp_ [*operator()]]] - [Initiate the deferred operation using the supplied completion token. ] + [Initiate the deferred operation using the supplied completion token. + [hr] + ] ] ] @@ -84749,22 +85391,30 @@ Construct a deferred asynchronous operation from the arguments to an initiation [endsect] +[section:operator_lp__rp_ deferred_values::operator()] -[section:detail__index_sequence_for deferred_values::detail::index_sequence_for] +[indexterm2 asio.indexterm.deferred_values.operator_lp__rp_..operator()..deferred_values] +Initiate the deferred operation using the supplied completion token. -[indexterm2 asio.indexterm.deferred_values.detail__index_sequence_for..detail::index_sequence_for..deferred_values] - auto detail::index_sequence_for(); + template< + typename CompletionToken> + auto ``[link asio.reference.deferred_values.operator_lp__rp_.overload1 operator()]``( + CompletionToken && token); + `` [''''»''' [link asio.reference.deferred_values.operator_lp__rp_.overload1 more...]]`` -[endsect] + template< + typename CompletionToken> + auto ``[link asio.reference.deferred_values.operator_lp__rp_.overload2 operator()]``( + CompletionToken && token) const; + `` [''''»''' [link asio.reference.deferred_values.operator_lp__rp_.overload2 more...]]`` +[section:overload1 deferred_values::operator() (1 of 2 overloads)] -[section:operator_lp__rp_ deferred_values::operator()] -[indexterm2 asio.indexterm.deferred_values.operator_lp__rp_..operator()..deferred_values] Initiate the deferred operation using the supplied completion token. @@ -84779,6 +85429,23 @@ Initiate the deferred operation using the supplied completion token. +[section:overload2 deferred_values::operator() (2 of 2 overloads)] + + + + template< + typename CompletionToken> + auto operator()( + CompletionToken && token) const; + + + +[endsect] + + +[endsect] + + [endsect] [section:deferred_values__initiate deferred_values::initiate] @@ -84865,6 +85532,13 @@ A [link asio.overview.model.completion_tokens completion token] type used to spe [table [[Name][Description]] + [ + + [[link asio.reference.detached_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use detached_t as its default completion token type. ] + + ] + [ [[link asio.reference.detached_t__executor_with_default [*executor_with_default]]] @@ -84894,7 +85568,7 @@ The [link asio.reference.detached_t `detached_t`] class is used to indicate that - my_socket.async_send(my_buffer, asio::detached); + my_socket.async_send(my_buffer, asio::detached); @@ -84914,7 +85588,7 @@ Function helper to adapt an I/O object to use `detached_t` as its default comple template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -84923,6 +85597,53 @@ Function helper to adapt an I/O object to use `detached_t` as its default comple +[section:as_default_on_t detached_t::as_default_on_t] + +[indexterm2 asio.indexterm.detached_t.as_default_on_t..as_default_on_t..detached_t] +Type alias to adapt an I/O object to use `detached_t` as its default completion token type. + + + typedef typename T::template rebind_executor< executor_with_default< typename T::executor_type > >::other as_default_on_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.detached_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify detached_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.detached_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. + [hr] + Convert the specified executor to the inner executor type, then use that to construct the adapted executor. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/detached.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:detached_t detached_t::detached_t] [indexterm2 asio.indexterm.detached_t.detached_t..detached_t..detached_t] @@ -84949,7 +85670,8 @@ Adapts an executor to add the `detached_t` completion token as the default. template< typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + struct executor_with_default : + public InnerExecutor [heading Types] @@ -84998,6 +85720,13 @@ Specify `detached_t` as the default completion token type. [table [[Name][Description]] + [ + + [[link asio.reference.detached_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use detached_t as its default completion token type. ] + + ] + [ [[link asio.reference.detached_t__executor_with_default [*executor_with_default]]] @@ -85027,7 +85756,7 @@ The [link asio.reference.detached_t `detached_t`] class is used to indicate that - my_socket.async_send(my_buffer, asio::detached); + my_socket.async_send(my_buffer, asio::detached); @@ -85061,7 +85790,7 @@ Convert the specified executor to the inner executor type, then use that to cons typename ``[link asio.reference.Executor1 OtherExecutor]``> ``[link asio.reference.detached_t__executor_with_default.executor_with_default.overload2 executor_with_default]``( const OtherExecutor & ex, - typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, InnerExecutor >::value > = 0); `` [''''»''' [link asio.reference.detached_t__executor_with_default.executor_with_default.overload2 more...]]`` @@ -85090,7 +85819,7 @@ Convert the specified executor to the inner executor type, then use that to cons typename ``[link asio.reference.Executor1 OtherExecutor]``> executor_with_default( const OtherExecutor & ex, - typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, InnerExecutor >::value > = 0); @@ -85143,26 +85872,26 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.NullaryToken NullaryToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.dispatch.overload1 dispatch]``( + auto ``[link asio.reference.dispatch.overload1 dispatch]``( NullaryToken && token); `` [''''»''' [link asio.reference.dispatch.overload1 more...]]`` template< typename ``[link asio.reference.Executor1 Executor]``, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.dispatch.overload2 dispatch]``( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link asio.reference.dispatch.overload2 dispatch]``( const Executor & ex, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< execution::is_executor< Executor >::value||is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.dispatch.overload2 more...]]`` template< typename ExecutionContext, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.dispatch.overload3 dispatch]``( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link asio.reference.dispatch.overload3 dispatch]``( ExecutionContext & ctx, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.dispatch.overload3 more...]]`` [heading Requirements] @@ -85180,7 +85909,7 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.NullaryToken NullaryToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` dispatch( + auto dispatch( NullaryToken && token); @@ -85194,7 +85923,7 @@ This function submits an object for execution using the object's associated exec [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -85208,11 +85937,11 @@ This function returns `async_initiate(Init{}, token)`, whe class Init - { - public: - template - void operator()(CompletionHandler&& completion_handler) const; - }; + { + public: + template + void operator()(CompletionHandler&& completion_handler) const; + }; @@ -85220,9 +85949,9 @@ This function returns `async_initiate(Init{}, token)`, whe The function call operator of `Init:` -* Obtains the handler's associated executor object `ex` of type `Ex` by performing +* Obtains the handler's associated executor object `ex` of type `Ex` by performing - auto ex = get_associated_executor(handler); + auto ex = get_associated_executor(handler); @@ -85230,7 +85959,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(handler); @@ -85238,8 +85967,8 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, performs - prefer(ex, execution::allocator(alloc)).execute( - std::forward(completion_handler)); + prefer(ex, execution::allocator(alloc)).execute( + std::forward(completion_handler)); @@ -85247,9 +85976,9 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, performs - ex.dispatch( - std::forward(completion_handler), - alloc); + ex.dispatch( + std::forward(completion_handler), + alloc); @@ -85259,7 +85988,7 @@ The function call operator of `Init:` - void() + void() @@ -85279,11 +86008,11 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.Executor1 Executor]``, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` dispatch( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto dispatch( const Executor & ex, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< execution::is_executor< Executor >::value||is_executor< Executor >::value > = 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. @@ -85298,7 +86027,7 @@ This function submits an object for execution using the specified executor. The [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -85312,16 +86041,16 @@ This function returns `async_initiate(Init{ex}, token)`, w class Init - { - public: - using executor_type = Executor; - explicit Init(const Executor& ex) : ex_(ex) {} - executor_type get_executor() const noexcept { return ex_; } - template - void operator()(CompletionHandler&& completion_handler) const; - private: - Executor ex_; // exposition only - }; + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler) const; + private: + Executor ex_; // exposition only + }; @@ -85329,9 +86058,9 @@ This function returns `async_initiate(Init{ex}, token)`, w The function call operator of `Init:` -* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing - auto ex1 = get_associated_executor(handler, ex); + auto ex1 = get_associated_executor(handler, ex); @@ -85339,7 +86068,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(handler); @@ -85348,7 +86077,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, constructs a function object `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: auto a = get_associated_allocator(handler_); - prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); @@ -85357,8 +86086,8 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, constructs a function object `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: auto a = get_associated_allocator(handler_); - work_.get_executor().dispatch(std::move(handler_), a); - work_.reset(); + work_.get_executor().dispatch(std::move(handler_), a); + work_.reset(); @@ -85366,7 +86095,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, performs - prefer(ex, execution::allocator(alloc)).execute(std::move(f)); + prefer(ex, execution::allocator(alloc)).execute(std::move(f)); @@ -85374,7 +86103,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, performs - ex.dispatch(std::move(f), alloc); + ex.dispatch(std::move(f), alloc); @@ -85384,7 +86113,7 @@ The function call operator of `Init:` - void() + void() @@ -85404,11 +86133,11 @@ Submits a completion token or function object for execution. template< typename ExecutionContext, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` dispatch( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto dispatch( ExecutionContext & ctx, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -85421,7 +86150,7 @@ Submits a completion token or function object for execution. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -85437,7 +86166,7 @@ Submits a completion token or function object for execution. - void() + void() @@ -85454,7 +86183,7 @@ Submits a completion token or function object for execution. [indexterm1 asio.indexterm.dynamic_buffer..dynamic_buffer] -The `asio::dynamic_buffer` function is used to create a dynamically resized buffer from a `std::basic_string` or `std::vector`. +The [link asio.reference.dynamic_buffer `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. @@ -85544,7 +86273,8 @@ Create a new dynamic buffer that represents the given string. [heading Return Value] -`dynamic_string_buffer(data, max_size)`. +`dynamic_string_buffer(data, +max_size)`. @@ -85828,8 +86558,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::const_buffer b1 = ...; - std::size_t s1 = b1.size(); - const unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + const unsigned char* p1 = static_cast(b1.data()); @@ -85858,7 +86588,7 @@ The `data()` member function permits violations of type safety, so uses of it in std::size_t n); -[*DynamicBuffer\_v1:] Removes `n` characters from the beginning of the input sequence. +[*DynamicBuffer\_v1:] Removes `n` characters from the beginning of the input sequence. [heading Remarks] If `n` is greater than the size of the input sequence, the entire input sequence is consumed and no error is issued. @@ -86205,8 +86935,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::mutable_buffer b1 = ...; - std::size_t s1 = b1.size(); - unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + unsigned char* p1 = static_cast(b1.data()); @@ -86526,8 +87256,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::const_buffer b1 = ...; - std::size_t s1 = b1.size(); - const unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + const unsigned char* p1 = static_cast(b1.data()); @@ -86556,7 +87286,7 @@ The `data()` member function permits violations of type safety, so uses of it in std::size_t n); -[*DynamicBuffer\_v1:] Removes `n` characters from the beginning of the input sequence. +[*DynamicBuffer\_v1:] Removes `n` characters from the beginning of the input sequence. [heading Remarks] If `n` is greater than the size of the input sequence, the entire input sequence is consumed and no error is issued. @@ -86893,8 +87623,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::mutable_buffer b1 = ...; - std::size_t s1 = b1.size(); - unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + unsigned char* p1 = static_cast(b1.data()); @@ -87405,7 +88135,7 @@ A cancellation filter that enables terminal, partial and total cancellation. [heading Requirements] -['Header: ][^asio/error.hpp] +['Header: ][^asio/impl/error.ipp] ['Convenience header: ][^asio.hpp] @@ -87424,7 +88154,7 @@ A cancellation filter that enables terminal, partial and total cancellation. [heading Requirements] -['Header: ][^asio/error.hpp] +['Header: ][^asio/impl/error.ipp] ['Convenience header: ][^asio.hpp] @@ -87443,7 +88173,7 @@ A cancellation filter that enables terminal, partial and total cancellation. [heading Requirements] -['Header: ][^asio/error.hpp] +['Header: ][^asio/impl/error.ipp] ['Convenience header: ][^asio.hpp] @@ -87776,48 +88506,15 @@ A cancellation filter that enables terminal, partial and total cancellation. [endsect] + [section:error_category error_category] [indexterm1 asio.indexterm.error_category..error_category] -Base class for all error categories. + typedef std::error_category error_category; - class error_category : - noncopyable - - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.error_category.message [*message]]] - [Returns a string describing the error denoted by value. ] - ] - - [ - [[link asio.reference.error_category.name [*name]]] - [Returns a string naming the error gategory. ] - ] - - [ - [[link asio.reference.error_category.operator_not__eq_ [*operator!=]]] - [Inequality operator to compare two error categories. ] - ] - - [ - [[link asio.reference.error_category.operator_eq__eq_ [*operator==]]] - [Equality operator to compare two error categories. ] - ] - - [ - [[link asio.reference.error_category._error_category [*~error_category]] [destructor]] - [Destructor. ] - ] - -] [heading Requirements] @@ -87826,363 +88523,18 @@ Base class for all error categories. ['Convenience header: ][^asio.hpp] -[section:message error_category::message] - -[indexterm2 asio.indexterm.error_category.message..message..error_category] -Returns a string describing the error denoted by `value`. - - - std::string message( - int value) const; - - - [endsect] -[section:name error_category::name] - -[indexterm2 asio.indexterm.error_category.name..name..error_category] -Returns a string naming the error gategory. - - - const char * name() const; - - - -[endsect] - - - -[section:operator_not__eq_ error_category::operator!=] - -[indexterm2 asio.indexterm.error_category.operator_not__eq_..operator!=..error_category] -Inequality operator to compare two error categories. - - - bool operator!=( - const error_category & rhs) const; - - - -[endsect] - - - -[section:operator_eq__eq_ error_category::operator==] - -[indexterm2 asio.indexterm.error_category.operator_eq__eq_..operator==..error_category] -Equality operator to compare two error categories. - - - bool operator==( - const error_category & rhs) const; - - - -[endsect] - - - -[section:_error_category error_category::~error_category] - -[indexterm2 asio.indexterm.error_category._error_category..~error_category..error_category] -Destructor. - - - virtual ~error_category(); - - - -[endsect] - - - -[endsect] - [section:error_code error_code] [indexterm1 asio.indexterm.error_code..error_code] -Class to represent an error code value. - - - class error_code - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.error_code__unspecified_bool_type_t [*unspecified_bool_type_t]]] - [] - - ] - - [ - - [[link asio.reference.error_code.unspecified_bool_type [*unspecified_bool_type]]] - [] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.error_code.assign [*assign]]] - [Assign a new error value. ] - ] - - [ - [[link asio.reference.error_code.category [*category]]] - [Get the error category. ] - ] - - [ - [[link asio.reference.error_code.clear [*clear]]] - [Clear the error value to the default. ] - ] - - [ - [[link asio.reference.error_code.error_code [*error_code]] [constructor]] - [Default constructor. - [hr] - Construct with specific error code and category. - [hr] - Construct from an error code enum. ] - ] - - [ - [[link asio.reference.error_code.message [*message]]] - [Get the message associated with the error. ] - ] - - [ - [[link asio.reference.error_code.operator_unspecified_bool_type [*operator unspecified_bool_type]]] - [Operator returns non-null if there is a non-success error code. ] - ] - - [ - [[link asio.reference.error_code.operator_not_ [*operator!]]] - [Operator to test if the error represents success. ] - ] - - [ - [[link asio.reference.error_code.unspecified_bool_true [*unspecified_bool_true]] [static]] - [] - ] - - [ - [[link asio.reference.error_code.value [*value]]] - [Get the error value. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.error_code.operator_not__eq_ [*operator!=]]] - [Inequality operator to compare two error objects. ] - ] - - [ - [[link asio.reference.error_code.operator_eq__eq_ [*operator==]]] - [Equality operator to compare two error objects. ] - ] - -] - -[heading Requirements] - -['Header: ][^asio/error_code.hpp] - -['Convenience header: ][^asio.hpp] - - -[section:assign error_code::assign] - -[indexterm2 asio.indexterm.error_code.assign..assign..error_code] -Assign a new error value. - - - void assign( - int v, - const error_category & c); - - - -[endsect] - - - -[section:category error_code::category] - -[indexterm2 asio.indexterm.error_code.category..category..error_code] -Get the error category. - - - const error_category & category() const; - - - -[endsect] - - - -[section:clear error_code::clear] - -[indexterm2 asio.indexterm.error_code.clear..clear..error_code] -Clear the error value to the default. - - - void clear(); - - - -[endsect] - - -[section:error_code error_code::error_code] - -[indexterm2 asio.indexterm.error_code.error_code..error_code..error_code] -Default constructor. - - - ``[link asio.reference.error_code.error_code.overload1 error_code]``(); - `` [''''»''' [link asio.reference.error_code.error_code.overload1 more...]]`` - - -Construct with specific error code and category. - - - ``[link asio.reference.error_code.error_code.overload2 error_code]``( - int v, - const error_category & c); - `` [''''»''' [link asio.reference.error_code.error_code.overload2 more...]]`` + typedef std::error_code error_code; -Construct from an error code enum. - - - template< - typename ErrorEnum> - ``[link asio.reference.error_code.error_code.overload3 error_code]``( - ErrorEnum e); - `` [''''»''' [link asio.reference.error_code.error_code.overload3 more...]]`` - - -[section:overload1 error_code::error_code (1 of 3 overloads)] - - -Default constructor. - - - error_code(); - - - -[endsect] - - - -[section:overload2 error_code::error_code (2 of 3 overloads)] - - -Construct with specific error code and category. - - - error_code( - int v, - const error_category & c); - - - -[endsect] - - - -[section:overload3 error_code::error_code (3 of 3 overloads)] - - -Construct from an error code enum. - - - template< - typename ErrorEnum> - error_code( - ErrorEnum e); - - - -[endsect] - - -[endsect] - - -[section:message error_code::message] - -[indexterm2 asio.indexterm.error_code.message..message..error_code] -Get the message associated with the error. - - - std::string message() const; - - - -[endsect] - - - -[section:operator_unspecified_bool_type error_code::operator unspecified_bool_type] - -[indexterm2 asio.indexterm.error_code.operator_unspecified_bool_type..operator unspecified_bool_type..error_code] -Operator returns non-null if there is a non-success error code. - - - operator unspecified_bool_type() const; - - - -[endsect] - - - -[section:operator_not_ error_code::operator!] - -[indexterm2 asio.indexterm.error_code.operator_not_..operator!..error_code] -Operator to test if the error represents success. - - - bool operator!() const; - - - -[endsect] - - - -[section:operator_not__eq_ error_code::operator!=] - -[indexterm2 asio.indexterm.error_code.operator_not__eq_..operator!=..error_code] -Inequality operator to compare two error objects. - - - friend bool operator!=( - const error_code & e1, - const error_code & e2); - [heading Requirements] @@ -88195,95 +88547,6 @@ Inequality operator to compare two error objects. -[section:operator_eq__eq_ error_code::operator==] - -[indexterm2 asio.indexterm.error_code.operator_eq__eq_..operator==..error_code] -Equality operator to compare two error objects. - - - friend bool operator==( - const error_code & e1, - const error_code & e2); - - -[heading Requirements] - -['Header: ][^asio/error_code.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:unspecified_bool_true error_code::unspecified_bool_true] - -[indexterm2 asio.indexterm.error_code.unspecified_bool_true..unspecified_bool_true..error_code] - - static void unspecified_bool_true( - unspecified_bool_type_t ); - - - -[endsect] - - - -[section:unspecified_bool_type error_code::unspecified_bool_type] - -[indexterm2 asio.indexterm.error_code.unspecified_bool_type..unspecified_bool_type..error_code] - - typedef void(*) unspecified_bool_type; - - - -[heading Requirements] - -['Header: ][^asio/error_code.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:value error_code::value] - -[indexterm2 asio.indexterm.error_code.value..value..error_code] -Get the error value. - - - int value() const; - - - -[endsect] - - - -[endsect] - -[section:error_code__unspecified_bool_type_t error_code::unspecified_bool_type_t] - -[indexterm1 asio.indexterm.error_code__unspecified_bool_type_t..error_code::unspecified_bool_type_t] - - - - struct unspecified_bool_type_t - - -[heading Requirements] - -['Header: ][^asio/error_code.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:execution__allocator execution::allocator] [indexterm1 asio.indexterm.execution__allocator..execution::allocator] @@ -88339,7 +88602,7 @@ A property to describe which allocator an executor will use to allocate the memo [ [[link asio.reference.execution__allocator_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The allocator_t property applies to executors, senders, and schedulers. ] + [The allocator_t property applies to executors. ] ] [ @@ -88378,12 +88641,11 @@ Default constructor. [section:is_applicable_property_v execution::allocator_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__allocator_t.is_applicable_property_v..is_applicable_property_v..execution::allocator_t] -The [link asio.reference.execution__allocator_t `execution::allocator_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__allocator_t `execution::allocator_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -88594,14 +88856,14 @@ Construct to point to the same target as another [link asio.reference.execution_ template< class... OtherSupportableProperties> ``[link asio.reference.execution__any_executor.any_executor.overload5 any_executor]``( - any_executor< OtherSupportableProperties...> e); + any_executor< OtherSupportableProperties... > e); `` [''''»''' [link asio.reference.execution__any_executor.any_executor.overload5 more...]]`` template< class... OtherSupportableProperties> ``[link asio.reference.execution__any_executor.any_executor.overload6 any_executor]``( std::nothrow_t , - any_executor< OtherSupportableProperties...> e); + any_executor< OtherSupportableProperties... > e); `` [''''»''' [link asio.reference.execution__any_executor.any_executor.overload6 more...]]`` ``[link asio.reference.execution__any_executor.any_executor.overload7 any_executor]``( @@ -88700,7 +88962,7 @@ Construct to point to the same target as another [link asio.reference.execution_ template< class... OtherSupportableProperties> any_executor( - any_executor< OtherSupportableProperties...> e); + any_executor< OtherSupportableProperties... > e); @@ -88718,7 +88980,7 @@ Construct to point to the same target as another [link asio.reference.execution_ class... OtherSupportableProperties> any_executor( std::nothrow_t , - any_executor< OtherSupportableProperties...> e); + any_executor< OtherSupportableProperties... > e); @@ -88856,19 +89118,25 @@ Determine whether the wrapper has a target executor. Inequality operator. + template< + typename... SupportableProperties> bool ``[link asio.reference.execution__any_executor.operator_not__eq_.overload1 operator!=]``( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.execution__any_executor.operator_not__eq_.overload1 more...]]`` + template< + typename... SupportableProperties> bool ``[link asio.reference.execution__any_executor.operator_not__eq_.overload2 operator!=]``( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); `` [''''»''' [link asio.reference.execution__any_executor.operator_not__eq_.overload2 more...]]`` + template< + typename... SupportableProperties> bool ``[link asio.reference.execution__any_executor.operator_not__eq_.overload3 operator!=]``( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.execution__any_executor.operator_not__eq_.overload3 more...]]`` @@ -88878,9 +89146,11 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); @@ -88894,8 +89164,10 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); @@ -88910,9 +89182,11 @@ Inequality operator. Inequality operator. + template< + typename... SupportableProperties> bool operator!=( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); @@ -89027,19 +89301,25 @@ Assignment operator to create a polymorphic wrapper for the specified executor. Equality operator. + template< + typename... SupportableProperties> bool ``[link asio.reference.execution__any_executor.operator_eq__eq_.overload1 operator==]``( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.execution__any_executor.operator_eq__eq_.overload1 more...]]`` + template< + typename... SupportableProperties> bool ``[link asio.reference.execution__any_executor.operator_eq__eq_.overload2 operator==]``( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); `` [''''»''' [link asio.reference.execution__any_executor.operator_eq__eq_.overload2 more...]]`` + template< + typename... SupportableProperties> bool ``[link asio.reference.execution__any_executor.operator_eq__eq_.overload3 operator==]``( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); `` [''''»''' [link asio.reference.execution__any_executor.operator_eq__eq_.overload3 more...]]`` @@ -89049,9 +89329,11 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( - const any_executor< SupportableProperties...> & a, - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & a, + const any_executor< SupportableProperties... > & b); @@ -89065,8 +89347,10 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( - const any_executor< SupportableProperties...> & a, + const any_executor< SupportableProperties... > & a, nullptr_t ); @@ -89081,9 +89365,11 @@ Equality operator. Equality operator. + template< + typename... SupportableProperties> bool operator==( nullptr_t , - const any_executor< SupportableProperties...> & b); + const any_executor< SupportableProperties... > & b); @@ -89110,7 +89396,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - auto ex2 = asio::prefer(ex, execution::blocking.possibly); + auto ex2 = asio::prefer(ex, execution::blocking.possibly); @@ -89137,7 +89423,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - size_t n = asio::query(ex, execution::occupancy); + size_t n = asio::query(ex, execution::occupancy); @@ -89164,7 +89450,7 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: execution::any_executor ex = ...; - auto ex2 = asio::requre(ex, execution::blocking.possibly); + auto ex2 = asio::requre(ex, execution::blocking.possibly); @@ -89278,7 +89564,7 @@ Exception thrown when trying to access an empty polymorphic executor. class bad_executor : - public std::exception + public exception [heading Member Functions] @@ -89443,7 +89729,7 @@ A property to describe whether automatic adaptation of an executor is allowed in [ [[link asio.reference.execution__blocking_adaptation_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_adaptation_t property applies to executors, senders, and schedulers. ] + [The blocking_adaptation_t property applies to executors. ] ] [ @@ -89579,12 +89865,11 @@ A special value used for accessing the [link asio.reference.execution__blocking_ [section:is_applicable_property_v execution::blocking_adaptation_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_adaptation_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_adaptation_t] -The [link asio.reference.execution__blocking_adaptation_t `execution::blocking_adaptation_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_adaptation_t `execution::blocking_adaptation_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -89626,7 +89911,7 @@ The top-level [link asio.reference.execution__blocking_adaptation_t `execution:: Compare property values for inequality. - friend constexpr bool operator!=( + constexpr bool operator!=( const blocking_adaptation_t & a, const blocking_adaptation_t & b); @@ -89648,7 +89933,7 @@ Compare property values for inequality. Compare property values for equality. - friend constexpr bool operator==( + constexpr bool operator==( const blocking_adaptation_t & a, const blocking_adaptation_t & b); @@ -89733,7 +90018,7 @@ A sub-property that indicates that automatic adaptation is allowed. [ [[link asio.reference.execution__blocking_adaptation_t__allowed_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_adaptation_t::allowed_t property applies to executors, senders, and schedulers. ] + [The blocking_adaptation_t::allowed_t property applies to executors. ] ] [ @@ -89772,12 +90057,11 @@ Default constructor. [section:is_applicable_property_v execution::blocking_adaptation_t::allowed_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_adaptation_t__allowed_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_adaptation_t::allowed_t] -The [link asio.reference.execution__blocking_adaptation_t__allowed_t `execution::blocking_adaptation_t::allowed_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_adaptation_t__allowed_t `execution::blocking_adaptation_t::allowed_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -89903,7 +90187,7 @@ A sub-property that indicates that automatic adaptation is not allowed. [ [[link asio.reference.execution__blocking_adaptation_t__disallowed_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_adaptation_t::disallowed_t property applies to executors, senders, and schedulers. ] + [The blocking_adaptation_t::disallowed_t property applies to executors. ] ] [ @@ -89942,12 +90226,11 @@ Default constructor. [section:is_applicable_property_v execution::blocking_adaptation_t::disallowed_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_adaptation_t__disallowed_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_adaptation_t::disallowed_t] -The [link asio.reference.execution__blocking_adaptation_t__disallowed_t `execution::blocking_adaptation_t::disallowed_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_adaptation_t__disallowed_t `execution::blocking_adaptation_t::disallowed_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -90096,7 +90379,7 @@ A property to describe what guarantees an executor makes about the blocking beha [ [[link asio.reference.execution__blocking_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_t property applies to executors, senders, and schedulers. ] + [The blocking_t property applies to executors. ] ] [ @@ -90247,12 +90530,11 @@ Construct from a sub-property value. [section:is_applicable_property_v execution::blocking_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_t] -The [link asio.reference.execution__blocking_t `execution::blocking_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_t `execution::blocking_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -90308,7 +90590,7 @@ A special value used for accessing the [link asio.reference.execution__blocking_ Compare property values for inequality. - friend constexpr bool operator!=( + constexpr bool operator!=( const blocking_t & a, const blocking_t & b); @@ -90330,7 +90612,7 @@ Compare property values for inequality. Compare property values for equality. - friend constexpr bool operator==( + constexpr bool operator==( const blocking_t & a, const blocking_t & b); @@ -90429,7 +90711,7 @@ A sub-property that indicates that invocation of an executor's execution functio [ [[link asio.reference.execution__blocking_t__always_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_t::always_t property applies to executors, senders, and schedulers. ] + [The blocking_t::always_t property applies to executors. ] ] [ @@ -90468,12 +90750,11 @@ Default constructor. [section:is_applicable_property_v execution::blocking_t::always_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_t__always_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_t::always_t] -The [link asio.reference.execution__blocking_t__always_t `execution::blocking_t::always_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_t__always_t `execution::blocking_t::always_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -90599,7 +90880,7 @@ A sub-property that indicates that invocation of an executor's execution functio [ [[link asio.reference.execution__blocking_t__never_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_t::never_t property applies to executors, senders, and schedulers. ] + [The blocking_t::never_t property applies to executors. ] ] [ @@ -90624,12 +90905,11 @@ A sub-property that indicates that invocation of an executor's execution functio [section:is_applicable_property_v execution::blocking_t::never_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_t__never_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_t::never_t] -The [link asio.reference.execution__blocking_t__never_t `execution::blocking_t::never_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_t__never_t `execution::blocking_t::never_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -90769,7 +91049,7 @@ A sub-property that indicates that invocation of an executor's execution functio [ [[link asio.reference.execution__blocking_t__possibly_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The blocking_t::possibly_t property applies to executors, senders, and schedulers. ] + [The blocking_t::possibly_t property applies to executors. ] ] [ @@ -90794,12 +91074,11 @@ A sub-property that indicates that invocation of an executor's execution functio [section:is_applicable_property_v execution::blocking_t::possibly_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__blocking_t__possibly_t.is_applicable_property_v..is_applicable_property_v..execution::blocking_t::possibly_t] -The [link asio.reference.execution__blocking_t__possibly_t `execution::blocking_t::possibly_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__blocking_t__possibly_t `execution::blocking_t::possibly_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -90891,1309 +91170,6 @@ Get the value associated with a property object. -[endsect] - - -[section:execution__bulk_execute execution::bulk_execute] - -[indexterm1 asio.indexterm.execution__bulk_execute..execution::bulk_execute] - -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` 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`, 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`, the program is ill-formed with no diagnostic required. - - -* 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`. - - - - -* Otherwise, `execution::bulk_execute(S, F, N)` is ill-formed. - - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_execute.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:execution__bulk_guarantee execution::bulk_guarantee] - -[indexterm1 asio.indexterm.execution__bulk_guarantee..execution::bulk_guarantee] - -A special value used for accessing the [link asio.reference.execution__bulk_guarantee_t `execution::bulk_guarantee_t`] property. - - - constexpr bulk_guarantee_t bulk_guarantee; - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - -[section:execution__bulk_guarantee_t execution::bulk_guarantee_t] - -[indexterm1 asio.indexterm.execution__bulk_guarantee_t..execution::bulk_guarantee_t] - - -A property to communicate the forward progress and ordering guarantees of execution agents associated with the bulk execution. - - - struct bulk_guarantee_t - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__bulk_guarantee_t__parallel_t [*parallel_t]]] - [A sub-property that indicates that execution agents within the same bulk execution may be parallelised. ] - - ] - - [ - - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t [*sequenced_t]]] - [A sub-property that indicates that execution agents within the same bulk execution may not be parallelised and vectorised. ] - - ] - - [ - - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t [*unsequenced_t]]] - [A sub-property that indicates that execution agents within the same bulk execution may be parallelised and vectorised. ] - - ] - - [ - - [[link asio.reference.execution__bulk_guarantee_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] - [The type returned by queries against an any_executor. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t [*bulk_guarantee_t]] [constructor]] - [Default constructor. - [hr] - Construct from a sub-property value. ] - ] - -] - -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The bulk_guarantee_t property applies to executors, senders, and schedulers. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t.is_preferable [*is_preferable]] [static]] - [The top-level bulk_guarantee_t property cannot be preferred. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t.is_requirable [*is_requirable]] [static]] - [The top-level bulk_guarantee_t property cannot be required. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t.parallel [*parallel]] [static]] - [A special value used for accessing the bulk_guarantee_t::parallel_t property. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t.sequenced [*sequenced]] [static]] - [A special value used for accessing the bulk_guarantee_t::sequenced_t property. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t.unsequenced [*unsequenced]] [static]] - [A special value used for accessing the bulk_guarantee_t::unsequenced_t property. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t.operator_not__eq_ [*operator!=]]] - [Compare property values for inequality. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t.operator_eq__eq_ [*operator==]]] - [Compare property values for equality. ] - ] - -] - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - -[section:bulk_guarantee_t execution::bulk_guarantee_t::bulk_guarantee_t] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.bulk_guarantee_t..bulk_guarantee_t..execution::bulk_guarantee_t] -Default constructor. - - - constexpr ``[link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload1 bulk_guarantee_t]``(); - `` [''''»''' [link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload1 more...]]`` - - -Construct from a sub-property value. - - - constexpr ``[link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload2 bulk_guarantee_t]``( - unsequenced_t ); - `` [''''»''' [link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload2 more...]]`` - - constexpr ``[link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload3 bulk_guarantee_t]``( - sequenced_t ); - `` [''''»''' [link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload3 more...]]`` - - constexpr ``[link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload4 bulk_guarantee_t]``( - parallel_t ); - `` [''''»''' [link asio.reference.execution__bulk_guarantee_t.bulk_guarantee_t.overload4 more...]]`` - - -[section:overload1 execution::bulk_guarantee_t::bulk_guarantee_t (1 of 4 overloads)] - - -Default constructor. - - - constexpr bulk_guarantee_t(); - - - -[endsect] - - - -[section:overload2 execution::bulk_guarantee_t::bulk_guarantee_t (2 of 4 overloads)] - - -Construct from a sub-property value. - - - constexpr bulk_guarantee_t( - unsequenced_t ); - - - -[endsect] - - - -[section:overload3 execution::bulk_guarantee_t::bulk_guarantee_t (3 of 4 overloads)] - - -Construct from a sub-property value. - - - constexpr bulk_guarantee_t( - sequenced_t ); - - - -[endsect] - - - -[section:overload4 execution::bulk_guarantee_t::bulk_guarantee_t (4 of 4 overloads)] - - -Construct from a sub-property value. - - - constexpr bulk_guarantee_t( - parallel_t ); - - - -[endsect] - - -[endsect] - - -[section:is_applicable_property_v execution::bulk_guarantee_t::is_applicable_property_v] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.is_applicable_property_v..is_applicable_property_v..execution::bulk_guarantee_t] -The [link asio.reference.execution__bulk_guarantee_t `execution::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; - - - -[endsect] - - - -[section:is_preferable execution::bulk_guarantee_t::is_preferable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.is_preferable..is_preferable..execution::bulk_guarantee_t] -The top-level [link asio.reference.execution__bulk_guarantee_t `execution::bulk_guarantee_t`] property cannot be preferred. - - - static constexpr bool is_preferable = false; - - - -[endsect] - - - -[section:is_requirable execution::bulk_guarantee_t::is_requirable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.is_requirable..is_requirable..execution::bulk_guarantee_t] -The top-level [link asio.reference.execution__bulk_guarantee_t `execution::bulk_guarantee_t`] property cannot be required. - - - static constexpr bool is_requirable = false; - - - -[endsect] - - - -[section:operator_not__eq_ execution::bulk_guarantee_t::operator!=] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.operator_not__eq_..operator!=..execution::bulk_guarantee_t] -Compare property values for inequality. - - - friend constexpr bool operator!=( - const bulk_guarantee_t & a, - const bulk_guarantee_t & b); - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:operator_eq__eq_ execution::bulk_guarantee_t::operator==] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.operator_eq__eq_..operator==..execution::bulk_guarantee_t] -Compare property values for equality. - - - friend constexpr bool operator==( - const bulk_guarantee_t & a, - const bulk_guarantee_t & b); - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:parallel execution::bulk_guarantee_t::parallel] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.parallel..parallel..execution::bulk_guarantee_t] -A special value used for accessing the [link asio.reference.execution__bulk_guarantee_t__parallel_t `execution::bulk_guarantee_t::parallel_t`] property. - - - static constexpr parallel_t parallel; - - - -[endsect] - - - -[section:polymorphic_query_result_type execution::bulk_guarantee_t::polymorphic_query_result_type] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::bulk_guarantee_t] -The type returned by queries against an `any_executor`. - - - typedef bulk_guarantee_t polymorphic_query_result_type; - - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:sequenced execution::bulk_guarantee_t::sequenced] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.sequenced..sequenced..execution::bulk_guarantee_t] -A special value used for accessing the [link asio.reference.execution__bulk_guarantee_t__sequenced_t `execution::bulk_guarantee_t::sequenced_t`] property. - - - static constexpr sequenced_t sequenced; - - - -[endsect] - - - -[section:unsequenced execution::bulk_guarantee_t::unsequenced] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t.unsequenced..unsequenced..execution::bulk_guarantee_t] -A special value used for accessing the [link asio.reference.execution__bulk_guarantee_t__unsequenced_t `execution::bulk_guarantee_t::unsequenced_t`] property. - - - static constexpr unsequenced_t unsequenced; - - - -[endsect] - - - -[endsect] - -[section:execution__bulk_guarantee_t__parallel_t execution::bulk_guarantee_t::parallel_t] - -[indexterm1 asio.indexterm.execution__bulk_guarantee_t__parallel_t..execution::bulk_guarantee_t::parallel_t] - - -A sub-property that indicates that execution agents within the same bulk execution may be parallelised. - - - struct parallel_t - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__bulk_guarantee_t__parallel_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] - [The type returned by queries against an any_executor. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t__parallel_t.parallel_t [*parallel_t]] [constructor]] - [Default constructor. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__parallel_t.value [*value]] [static]] - [Get the value associated with a property object. ] - ] - -] - -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t__parallel_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The bulk_guarantee_t::parallel_t property applies to executors, senders, and schedulers. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__parallel_t.is_preferable [*is_preferable]] [static]] - [The bulk_guarantee_t::parallel_t property can be preferred. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__parallel_t.is_requirable [*is_requirable]] [static]] - [The bulk_guarantee_t::parallel_t property can be required. ] - ] - -] - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:is_applicable_property_v execution::bulk_guarantee_t::parallel_t::is_applicable_property_v] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__parallel_t.is_applicable_property_v..is_applicable_property_v..execution::bulk_guarantee_t::parallel_t] -The [link asio.reference.execution__bulk_guarantee_t__parallel_t `execution::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; - - - -[endsect] - - - -[section:is_preferable execution::bulk_guarantee_t::parallel_t::is_preferable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__parallel_t.is_preferable..is_preferable..execution::bulk_guarantee_t::parallel_t] -The [link asio.reference.execution__bulk_guarantee_t__parallel_t `execution::bulk_guarantee_t::parallel_t`] property can be preferred. - - - static constexpr bool is_preferable = true; - - - -[endsect] - - - -[section:is_requirable execution::bulk_guarantee_t::parallel_t::is_requirable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__parallel_t.is_requirable..is_requirable..execution::bulk_guarantee_t::parallel_t] -The [link asio.reference.execution__bulk_guarantee_t__parallel_t `execution::bulk_guarantee_t::parallel_t`] property can be required. - - - static constexpr bool is_requirable = true; - - - -[endsect] - - - -[section:parallel_t execution::bulk_guarantee_t::parallel_t::parallel_t] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__parallel_t.parallel_t..parallel_t..execution::bulk_guarantee_t::parallel_t] -Default constructor. - - - constexpr parallel_t(); - - - -[endsect] - - - -[section:polymorphic_query_result_type execution::bulk_guarantee_t::parallel_t::polymorphic_query_result_type] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__parallel_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::bulk_guarantee_t::parallel_t] -The type returned by queries against an `any_executor`. - - - typedef bulk_guarantee_t polymorphic_query_result_type; - - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:value execution::bulk_guarantee_t::parallel_t::value] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__parallel_t.value..value..execution::bulk_guarantee_t::parallel_t] -Get the value associated with a property object. - - - static constexpr bulk_guarantee_t value(); - - - -[heading Return Value] - -`parallel_t()`; - - - - -[endsect] - - - -[endsect] - -[section:execution__bulk_guarantee_t__sequenced_t execution::bulk_guarantee_t::sequenced_t] - -[indexterm1 asio.indexterm.execution__bulk_guarantee_t__sequenced_t..execution::bulk_guarantee_t::sequenced_t] - - -A sub-property that indicates that execution agents within the same bulk execution may not be parallelised and vectorised. - - - struct sequenced_t - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] - [The type returned by queries against an any_executor. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t.sequenced_t [*sequenced_t]] [constructor]] - [Default constructor. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t.value [*value]] [static]] - [Get the value associated with a property object. ] - ] - -] - -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The bulk_guarantee_t::sequenced_t property applies to executors, senders, and schedulers. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t.is_preferable [*is_preferable]] [static]] - [The bulk_guarantee_t::sequenced_t property can be preferred. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__sequenced_t.is_requirable [*is_requirable]] [static]] - [The bulk_guarantee_t::sequenced_t property can be required. ] - ] - -] - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:is_applicable_property_v execution::bulk_guarantee_t::sequenced_t::is_applicable_property_v] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__sequenced_t.is_applicable_property_v..is_applicable_property_v..execution::bulk_guarantee_t::sequenced_t] -The [link asio.reference.execution__bulk_guarantee_t__sequenced_t `execution::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; - - - -[endsect] - - - -[section:is_preferable execution::bulk_guarantee_t::sequenced_t::is_preferable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__sequenced_t.is_preferable..is_preferable..execution::bulk_guarantee_t::sequenced_t] -The [link asio.reference.execution__bulk_guarantee_t__sequenced_t `execution::bulk_guarantee_t::sequenced_t`] property can be preferred. - - - static constexpr bool is_preferable = true; - - - -[endsect] - - - -[section:is_requirable execution::bulk_guarantee_t::sequenced_t::is_requirable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__sequenced_t.is_requirable..is_requirable..execution::bulk_guarantee_t::sequenced_t] -The [link asio.reference.execution__bulk_guarantee_t__sequenced_t `execution::bulk_guarantee_t::sequenced_t`] property can be required. - - - static constexpr bool is_requirable = true; - - - -[endsect] - - - -[section:polymorphic_query_result_type execution::bulk_guarantee_t::sequenced_t::polymorphic_query_result_type] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__sequenced_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::bulk_guarantee_t::sequenced_t] -The type returned by queries against an `any_executor`. - - - typedef bulk_guarantee_t polymorphic_query_result_type; - - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:sequenced_t execution::bulk_guarantee_t::sequenced_t::sequenced_t] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__sequenced_t.sequenced_t..sequenced_t..execution::bulk_guarantee_t::sequenced_t] -Default constructor. - - - constexpr sequenced_t(); - - - -[endsect] - - - -[section:value execution::bulk_guarantee_t::sequenced_t::value] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__sequenced_t.value..value..execution::bulk_guarantee_t::sequenced_t] -Get the value associated with a property object. - - - static constexpr bulk_guarantee_t value(); - - - -[heading Return Value] - -`sequenced_t()`; - - - - -[endsect] - - - -[endsect] - -[section:execution__bulk_guarantee_t__unsequenced_t execution::bulk_guarantee_t::unsequenced_t] - -[indexterm1 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t..execution::bulk_guarantee_t::unsequenced_t] - - -A sub-property that indicates that execution agents within the same bulk execution may be parallelised and vectorised. - - - struct unsequenced_t - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] - [The type returned by queries against an any_executor. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t.unsequenced_t [*unsequenced_t]] [constructor]] - [Default constructor. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t.value [*value]] [static]] - [Get the value associated with a property object. ] - ] - -] - -[heading Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The bulk_guarantee_t::unsequenced_t property applies to executors, senders, and schedulers. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t.is_preferable [*is_preferable]] [static]] - [The bulk_guarantee_t::unsequenced_t property can be preferred. ] - ] - - [ - [[link asio.reference.execution__bulk_guarantee_t__unsequenced_t.is_requirable [*is_requirable]] [static]] - [The bulk_guarantee_t::unsequenced_t property can be required. ] - ] - -] - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:is_applicable_property_v execution::bulk_guarantee_t::unsequenced_t::is_applicable_property_v] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t.is_applicable_property_v..is_applicable_property_v..execution::bulk_guarantee_t::unsequenced_t] -The [link asio.reference.execution__bulk_guarantee_t__unsequenced_t `execution::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; - - - -[endsect] - - - -[section:is_preferable execution::bulk_guarantee_t::unsequenced_t::is_preferable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t.is_preferable..is_preferable..execution::bulk_guarantee_t::unsequenced_t] -The [link asio.reference.execution__bulk_guarantee_t__unsequenced_t `execution::bulk_guarantee_t::unsequenced_t`] property can be preferred. - - - static constexpr bool is_preferable = true; - - - -[endsect] - - - -[section:is_requirable execution::bulk_guarantee_t::unsequenced_t::is_requirable] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t.is_requirable..is_requirable..execution::bulk_guarantee_t::unsequenced_t] -The [link asio.reference.execution__bulk_guarantee_t__unsequenced_t `execution::bulk_guarantee_t::unsequenced_t`] property can be required. - - - static constexpr bool is_requirable = true; - - - -[endsect] - - - -[section:polymorphic_query_result_type execution::bulk_guarantee_t::unsequenced_t::polymorphic_query_result_type] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::bulk_guarantee_t::unsequenced_t] -The type returned by queries against an `any_executor`. - - - typedef bulk_guarantee_t polymorphic_query_result_type; - - - -[heading Requirements] - -['Header: ][^asio/execution/bulk_guarantee.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:unsequenced_t execution::bulk_guarantee_t::unsequenced_t::unsequenced_t] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t.unsequenced_t..unsequenced_t..execution::bulk_guarantee_t::unsequenced_t] -Default constructor. - - - constexpr unsequenced_t(); - - - -[endsect] - - - -[section:value execution::bulk_guarantee_t::unsequenced_t::value] - -[indexterm2 asio.indexterm.execution__bulk_guarantee_t__unsequenced_t.value..value..execution::bulk_guarantee_t::unsequenced_t] -Get the value associated with a property object. - - - static constexpr bulk_guarantee_t value(); - - - -[heading Return Value] - -`unsequenced_t()`; - - - - -[endsect] - - - -[endsect] - -[section:execution__can_bulk_execute execution::can_bulk_execute] - -[indexterm1 asio.indexterm.execution__can_bulk_execute..execution::can_bulk_execute] - - -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(), std::declval(), std::declval)` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/bulk_execute.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_connect execution::can_connect] - -[indexterm1 asio.indexterm.execution__can_connect..execution::can_connect] - - -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(), std::declval())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/connect.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_execute execution::can_execute] - -[indexterm1 asio.indexterm.execution__can_execute..execution::can_execute] - - -(Deprecated.) A type trait that determines whether an `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(), std::declval())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/execute.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_schedule execution::can_schedule] - -[indexterm1 asio.indexterm.execution__can_schedule..execution::can_schedule] - - -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())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/schedule.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_set_done execution::can_set_done] - -[indexterm1 asio.indexterm.execution__can_set_done..execution::can_set_done] - - -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(), std::declval())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/set_done.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_set_error execution::can_set_error] - -[indexterm1 asio.indexterm.execution__can_set_error..execution::can_set_error] - - -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(), std::declval())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/set_error.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_set_value execution::can_set_value] - -[indexterm1 asio.indexterm.execution__can_set_value..execution::can_set_value] - - -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(), std::declval()...)` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/set_value.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_start execution::can_start] - -[indexterm1 asio.indexterm.execution__can_start..execution::can_start] - - -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(), std::declval())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/start.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__can_submit execution::can_submit] - -[indexterm1 asio.indexterm.execution__can_submit..execution::can_submit] - - -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(), std::declval())` is well formed; otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/submit.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - -[section:execution__connect execution::connect] - -[indexterm1 asio.indexterm.execution__connect..execution::connect] - -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` 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 - - 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()); - } - }; - - -and `as_invocable` is a class template equivalent to the following: - - 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; - } - }; - - - - - -* Otherwise, `execution::connect(s, r)` is ill-formed. - - - -[heading Requirements] - -['Header: ][^asio/execution/connect.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - -[section:execution__connect_result execution::connect_result] - -[indexterm1 asio.indexterm.execution__connect_result..execution::connect_result] - - -A type trait to determine the result of a `connect` expression. - - - template< - typename S, - typename R> - struct connect_result - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__connect_result.type [*type]]] - [The type of the connect expression. ] - - ] - -] - -[heading Requirements] - -['Header: ][^asio/execution/connect.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:type execution::connect_result::type] - -[indexterm2 asio.indexterm.execution__connect_result.type..type..execution::connect_result] -The type of the connect expression. - - - typedef automatically_determined type; - - - -The type of the expression `execution::connect(std::declval(), std::declval())`. - -[heading Requirements] - -['Header: ][^asio/execution/connect.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - [endsect] @@ -92271,7 +91247,7 @@ A property that is used to obtain the execution context that is associated with [ [[link asio.reference.execution__context_as_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The context_as_t property applies to executors, senders, and schedulers. ] + [The context_as_t property applies to executors. ] ] [ @@ -92296,12 +91272,11 @@ A property that is used to obtain the execution context that is associated with [section:is_applicable_property_v execution::context_as_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__context_as_t.is_applicable_property_v..is_applicable_property_v..execution::context_as_t] -The [link asio.reference.execution__context_as_t `execution::context_as_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__context_as_t `execution::context_as_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -92390,7 +91365,7 @@ A property that is used to obtain the execution context that is associated with [ [[link asio.reference.execution__context_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The context_t property applies to executors, senders, and schedulers. ] + [The context_t property applies to executors. ] ] [ @@ -92415,12 +91390,11 @@ A property that is used to obtain the execution context that is associated with [section:is_applicable_property_v execution::context_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__context_t.is_applicable_property_v..is_applicable_property_v..execution::context_t] -The [link asio.reference.execution__context_t `execution::context_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__context_t `execution::context_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -92477,155 +91451,6 @@ The type returned by queries against an `any_executor`. -[endsect] - - -[section:execution__execute execution::execute] - -[indexterm1 asio.indexterm.execution__execute..execution::execute] - -(Deprecated: Use `execute` member function.) 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. - - - -[heading Requirements] - -['Header: ][^asio/execution/execute.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - -[section:execution__executor_index execution::executor_index] - -[indexterm1 asio.indexterm.execution__executor_index..execution::executor_index] - - -The [link asio.reference.execution__executor_index `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 - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__executor_index.type [*type]]] - [T::index_type if T::index_type is valid, otherwise executor_shape_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`. - -[heading Requirements] - -['Header: ][^asio/execution/executor.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:type execution::executor_index::type] - -[indexterm2 asio.indexterm.execution__executor_index.type..type..execution::executor_index] -`T::index_type` if `T::index_type` is valid, otherwise `executor_shape_t`. - - - typedef automatically_determined type; - - - -[heading Requirements] - -['Header: ][^asio/execution/executor.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[endsect] - -[section:execution__executor_shape execution::executor_shape] - -[indexterm1 asio.indexterm.execution__executor_shape..execution::executor_shape] - - -The [link asio.reference.execution__executor_shape `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 - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.execution__executor_shape.type [*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`. - -[heading Requirements] - -['Header: ][^asio/execution/executor.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:type execution::executor_shape::type] - -[indexterm2 asio.indexterm.execution__executor_shape.type..type..execution::executor_shape] -`T::shape_type` if `T::shape_type` is valid, otherwise `std::size_t`. - - - typedef automatically_determined type; - - - -[heading Requirements] - -['Header: ][^asio/execution/executor.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - [endsect] [section:execution__invocable_archetype execution::invocable_archetype] @@ -92686,7 +91511,8 @@ The [link asio.reference.execution__is_executor `execution::is_executor`] trait template< typename T> - struct is_executor + struct is_executor : + public integral_constant< bool, automatically_determined > 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`. @@ -92698,227 +91524,6 @@ Class template `is_executor` is a UnaryTypeTrait that is derived from `true_type ['Convenience header: ][^asio/execution.hpp] -[endsect] - -[section:execution__is_executor_of execution::is_executor_of] - -[indexterm1 asio.indexterm.execution__is_executor_of..execution::is_executor_of] - - -The [link asio.reference.execution__is_executor_of `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`. - -[heading Requirements] - -['Header: ][^asio/execution/executor.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_nothrow_receiver_of execution::is_nothrow_receiver_of] - -[indexterm1 asio.indexterm.execution__is_nothrow_receiver_of..execution::is_nothrow_receiver_of] - - -The [link asio.reference.execution__is_nothrow_receiver_of `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(), declval()...)` is noexcept, otherwise `false_type`. - -[heading Requirements] - -['Header: ][^asio/execution/receiver.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_operation_state execution::is_operation_state] - -[indexterm1 asio.indexterm.execution__is_operation_state..execution::is_operation_state] - - -The [link asio.reference.execution__is_operation_state `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`. - -[heading Requirements] - -['Header: ][^asio/execution/operation_state.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_receiver execution::is_receiver] - -[indexterm1 asio.indexterm.execution__is_receiver..execution::is_receiver] - - -The [link asio.reference.execution__is_receiver `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`. - -[heading Requirements] - -['Header: ][^asio/execution/receiver.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_receiver_of execution::is_receiver_of] - -[indexterm1 asio.indexterm.execution__is_receiver_of..execution::is_receiver_of] - - -The [link asio.reference.execution__is_receiver_of `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`. - -[heading Requirements] - -['Header: ][^asio/execution/receiver.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_scheduler execution::is_scheduler] - -[indexterm1 asio.indexterm.execution__is_scheduler..execution::is_scheduler] - - -The [link asio.reference.execution__is_scheduler `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`. - -[heading Requirements] - -['Header: ][^asio/execution/scheduler.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_sender execution::is_sender] - -[indexterm1 asio.indexterm.execution__is_sender..execution::is_sender] - - -The [link asio.reference.execution__is_sender `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`. - -[heading Requirements] - -['Header: ][^asio/execution/sender.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_sender_to execution::is_sender_to] - -[indexterm1 asio.indexterm.execution__is_sender_to..execution::is_sender_to] - - -The [link asio.reference.execution__is_sender_to `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`. - -[heading Requirements] - -['Header: ][^asio/execution/sender.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - -[section:execution__is_typed_sender execution::is_typed_sender] - -[indexterm1 asio.indexterm.execution__is_typed_sender..execution::is_typed_sender] - - -The [link asio.reference.execution__is_typed_sender `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`. - -[heading Requirements] - -['Header: ][^asio/execution/sender.hpp] - -['Convenience header: ][^asio/execution.hpp] - - [endsect] @@ -93006,7 +91611,7 @@ A property to describe what guarantees an executor makes about the mapping of ex [ [[link asio.reference.execution__mapping_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The mapping_t property applies to executors, senders, and schedulers. ] + [The mapping_t property applies to executors. ] ] [ @@ -93062,12 +91667,11 @@ A property to describe what guarantees an executor makes about the mapping of ex [section:is_applicable_property_v execution::mapping_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__mapping_t.is_applicable_property_v..is_applicable_property_v..execution::mapping_t] -The [link asio.reference.execution__mapping_t `execution::mapping_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__mapping_t `execution::mapping_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -93209,7 +91813,7 @@ A special value used for accessing the [link asio.reference.execution__mapping_t Compare property values for inequality. - friend constexpr bool operator!=( + constexpr bool operator!=( const mapping_t & a, const mapping_t & b); @@ -93231,7 +91835,7 @@ Compare property values for inequality. Compare property values for equality. - friend constexpr bool operator==( + constexpr bool operator==( const mapping_t & a, const mapping_t & b); @@ -93344,7 +91948,7 @@ A sub-property that indicates that execution agents are mapped on to new threads [ [[link asio.reference.execution__mapping_t__new_thread_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The mapping_t::new_thread_t property applies to executors, senders, and schedulers. ] + [The mapping_t::new_thread_t property applies to executors. ] ] [ @@ -93369,12 +91973,11 @@ A sub-property that indicates that execution agents are mapped on to new threads [section:is_applicable_property_v execution::mapping_t::new_thread_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__mapping_t__new_thread_t.is_applicable_property_v..is_applicable_property_v..execution::mapping_t::new_thread_t] -The [link asio.reference.execution__mapping_t__new_thread_t `execution::mapping_t::new_thread_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__mapping_t__new_thread_t `execution::mapping_t::new_thread_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -93514,7 +92117,7 @@ A sub-property that indicates that the mapping of execution agents is implementa [ [[link asio.reference.execution__mapping_t__other_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The mapping_t::other_t property applies to executors, senders, and schedulers. ] + [The mapping_t::other_t property applies to executors. ] ] [ @@ -93539,12 +92142,11 @@ A sub-property that indicates that the mapping of execution agents is implementa [section:is_applicable_property_v execution::mapping_t::other_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__mapping_t__other_t.is_applicable_property_v..is_applicable_property_v..execution::mapping_t::other_t] -The [link asio.reference.execution__mapping_t__other_t `execution::mapping_t::other_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__mapping_t__other_t `execution::mapping_t::other_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -93684,7 +92286,7 @@ A sub-property that indicates that execution agents are mapped on to threads of [ [[link asio.reference.execution__mapping_t__thread_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The mapping_t::thread_t property applies to executors, senders, and schedulers. ] + [The mapping_t::thread_t property applies to executors. ] ] [ @@ -93709,12 +92311,11 @@ A sub-property that indicates that execution agents are mapped on to threads of [section:is_applicable_property_v execution::mapping_t::thread_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__mapping_t__thread_t.is_applicable_property_v..is_applicable_property_v..execution::mapping_t::thread_t] -The [link asio.reference.execution__mapping_t__thread_t `execution::mapping_t::thread_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__mapping_t__thread_t `execution::mapping_t::thread_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -93859,7 +92460,7 @@ A property that gives an estimate of the number of execution agents that should [ [[link asio.reference.execution__occupancy_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The occupancy_t property applies to executors, senders, and schedulers. ] + [The occupancy_t property applies to executors. ] ] [ @@ -93884,12 +92485,11 @@ A property that gives an estimate of the number of execution agents that should [section:is_applicable_property_v execution::occupancy_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__occupancy_t.is_applicable_property_v..is_applicable_property_v..execution::occupancy_t] -The [link asio.reference.execution__occupancy_t `execution::occupancy_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__occupancy_t `execution::occupancy_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -94026,7 +92626,7 @@ A property to describe whether task submission is likely in the future. [ [[link asio.reference.execution__outstanding_work_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The outstanding_work_t property applies to executors, senders, and schedulers. ] + [The outstanding_work_t property applies to executors. ] ] [ @@ -94077,12 +92677,11 @@ A property to describe whether task submission is likely in the future. [section:is_applicable_property_v execution::outstanding_work_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__outstanding_work_t.is_applicable_property_v..is_applicable_property_v..execution::outstanding_work_t] -The [link asio.reference.execution__outstanding_work_t `execution::outstanding_work_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__outstanding_work_t `execution::outstanding_work_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -94124,7 +92723,7 @@ The top-level [link asio.reference.execution__outstanding_work_t `execution::out Compare property values for inequality. - friend constexpr bool operator!=( + constexpr bool operator!=( const outstanding_work_t & a, const outstanding_work_t & b); @@ -94146,7 +92745,7 @@ Compare property values for inequality. Compare property values for equality. - friend constexpr bool operator==( + constexpr bool operator==( const outstanding_work_t & a, const outstanding_work_t & b); @@ -94326,7 +92925,7 @@ A sub-property that indicates that the executor represents likely future submiss [ [[link asio.reference.execution__outstanding_work_t__tracked_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The outstanding_work_t::untracked_t property applies to executors, senders, and schedulers. ] + [The outstanding_work_t::untracked_t property applies to executors. ] ] [ @@ -94351,12 +92950,11 @@ A sub-property that indicates that the executor represents likely future submiss [section:is_applicable_property_v execution::outstanding_work_t::tracked_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__outstanding_work_t__tracked_t.is_applicable_property_v..is_applicable_property_v..execution::outstanding_work_t::tracked_t] -The [link asio.reference.execution__outstanding_work_t__untracked_t `execution::outstanding_work_t::untracked_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__outstanding_work_t__untracked_t `execution::outstanding_work_t::untracked_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -94496,7 +93094,7 @@ A sub-property that indicates that the executor does not represent likely future [ [[link asio.reference.execution__outstanding_work_t__untracked_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The outstanding_work_t::untracked_t property applies to executors, senders, and schedulers. ] + [The outstanding_work_t::untracked_t property applies to executors. ] ] [ @@ -94521,12 +93119,11 @@ A sub-property that indicates that the executor does not represent likely future [section:is_applicable_property_v execution::outstanding_work_t::untracked_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__outstanding_work_t__untracked_t.is_applicable_property_v..is_applicable_property_v..execution::outstanding_work_t::untracked_t] -The [link asio.reference.execution__outstanding_work_t__untracked_t `execution::outstanding_work_t::untracked_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__outstanding_work_t__untracked_t `execution::outstanding_work_t::untracked_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -94681,7 +93278,8 @@ The [link asio.reference.execution__prefer_only `execution::prefer_only`] adapte template - static constexpr bool is_applicable_property_v =is_applicable_property::value; + static constexpr bool is_applicable_property_v = + is_applicable_property::value; @@ -94740,51 +93338,6 @@ The type returned by queries against an `any_executor`. -[endsect] - -[section:execution__receiver_invocation_error execution::receiver_invocation_error] - -[indexterm1 asio.indexterm.execution__receiver_invocation_error..execution::receiver_invocation_error] - - -Exception reported via `set_error` when an exception escapes from `set_value`. - - - class receiver_invocation_error - - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.execution__receiver_invocation_error.receiver_invocation_error [*receiver_invocation_error]] [constructor]] - [Constructor. ] - ] - -] - -[heading Requirements] - -['Header: ][^asio/execution/receiver_invocation_error.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[section:receiver_invocation_error execution::receiver_invocation_error::receiver_invocation_error] - -[indexterm2 asio.indexterm.execution__receiver_invocation_error.receiver_invocation_error..receiver_invocation_error..execution::receiver_invocation_error] -Constructor. - - - receiver_invocation_error(); - - - -[endsect] - - - [endsect] @@ -94875,7 +93428,7 @@ A property to describe whether submitted tasks represent continuations of the ca [ [[link asio.reference.execution__relationship_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The relationship_t property applies to executors, senders, and schedulers. ] + [The relationship_t property applies to executors. ] ] [ @@ -94944,12 +93497,11 @@ A special value used for accessing the [link asio.reference.execution__relations [section:is_applicable_property_v execution::relationship_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__relationship_t.is_applicable_property_v..is_applicable_property_v..execution::relationship_t] -The [link asio.reference.execution__relationship_t `execution::relationship_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__relationship_t `execution::relationship_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -94991,7 +93543,7 @@ The top-level [link asio.reference.execution__relationship_t `execution::relatio Compare property values for inequality. - friend constexpr bool operator!=( + constexpr bool operator!=( const relationship_t & a, const relationship_t & b); @@ -95013,7 +93565,7 @@ Compare property values for inequality. Compare property values for equality. - friend constexpr bool operator==( + constexpr bool operator==( const relationship_t & a, const relationship_t & b); @@ -95165,7 +93717,7 @@ A sub-property that indicates that the executor represents a continuation of the [ [[link asio.reference.execution__relationship_t__continuation_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The relationship_t::continuation_t property applies to executors, senders, and schedulers. ] + [The relationship_t::continuation_t property applies to executors. ] ] [ @@ -95204,12 +93756,11 @@ Default constructor. [section:is_applicable_property_v execution::relationship_t::continuation_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__relationship_t__continuation_t.is_applicable_property_v..is_applicable_property_v..execution::relationship_t::continuation_t] -The [link asio.reference.execution__relationship_t__continuation_t `execution::relationship_t::continuation_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__relationship_t__continuation_t `execution::relationship_t::continuation_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -95335,7 +93886,7 @@ A sub-property that indicates that the executor does not represent a continuatio [ [[link asio.reference.execution__relationship_t__fork_t.is_applicable_property_v [*is_applicable_property_v]] [static]] - [The relationship_t::fork_t property applies to executors, senders, and schedulers. ] + [The relationship_t::fork_t property applies to executors. ] ] [ @@ -95374,12 +93925,11 @@ Default constructor. [section:is_applicable_property_v execution::relationship_t::fork_t::is_applicable_property_v] [indexterm2 asio.indexterm.execution__relationship_t__fork_t.is_applicable_property_v..is_applicable_property_v..execution::relationship_t::fork_t] -The [link asio.reference.execution__relationship_t__fork_t `execution::relationship_t::fork_t`] property applies to executors, senders, and schedulers. +The [link asio.reference.execution__relationship_t__fork_t `execution::relationship_t::fork_t`] property applies to executors. template - static constexpr bool is_applicable_property_v = - is_executor_v || is_sender_v || is_scheduler_v; + static constexpr bool is_applicable_property_v = is_executor_v; @@ -95459,289 +94009,6 @@ Get the value associated with a property object. [endsect] - -[section:execution__schedule execution::schedule] - -[indexterm1 asio.indexterm.execution__schedule..execution::schedule] - -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. - - - -[heading Requirements] - -['Header: ][^asio/execution/schedule.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:execution__sender_base execution::sender_base] - -[indexterm1 asio.indexterm.execution__sender_base..execution::sender_base] - -Base class used for tagging senders. - - - typedef unspecified sender_base; - - - -[heading Requirements] - -['Header: ][^asio/execution/sender.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - -[section:execution__sender_traits execution::sender_traits] - -[indexterm1 asio.indexterm.execution__sender_traits..execution::sender_traits] - - -Traits for senders. - - - template< - typename S> - struct sender_traits - - -[heading Requirements] - -['Header: ][^asio/execution/sender.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - -[section:execution__set_done execution::set_done] - -[indexterm1 asio.indexterm.execution__set_done..execution::set_done] - -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. - - - -[heading Requirements] - -['Header: ][^asio/execution/set_done.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:execution__set_error execution::set_error] - -[indexterm1 asio.indexterm.execution__set_error..execution::set_error] - -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. - - - -[heading Requirements] - -['Header: ][^asio/execution/set_error.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:execution__set_value execution::set_value] - -[indexterm1 asio.indexterm.execution__set_value..execution::set_value] - -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. - - - -[heading Requirements] - -['Header: ][^asio/execution/set_value.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:execution__start execution::start] - -[indexterm1 asio.indexterm.execution__start..execution::start] - -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. - - - -[heading Requirements] - -['Header: ][^asio/execution/start.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - - -[section:execution__submit execution::submit] - -[indexterm1 asio.indexterm.execution__submit..execution::submit] - -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` 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})->state_)`, where `submit_receiver` is an implementation-defined class template equivalent to: - - template - struct submit_receiver { - struct wrap { - submit_receiver * p_; - template - requires receiver_of - void set_value(As&&... as) && - noexcept(is_nothrow_receiver_of_v) { - execution::set_value(std::move(p_->r_), (As&&) as...); - delete p_; - } - template - requires receiver - 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_; - connect_result_t state_; - submit_receiver(S&& s, R&& r) - : r_((R&&) r) - , state_(execution::connect((S&&) s, wrap{this})) {} - }; - - - - - - -[heading Requirements] - -['Header: ][^asio/execution/submit.hpp] - -['Convenience header: ][^asio/execution.hpp] - - -[endsect] - - [section:execution_context execution_context] [indexterm1 asio.indexterm.execution_context..execution_context] @@ -95899,7 +94166,7 @@ This destruction sequence permits programs to simplify their resource management template< typename ``[link asio.reference.Service Service]``> - friend void add_service( + void add_service( execution_context & e, Service * svc); @@ -95914,9 +94181,9 @@ This function is used to add a service to the [link asio.reference.execution_con [[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] -[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: +[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: `` - delete static_cast(svc) + delete static_cast(svc) `` ]] @@ -96027,7 +94294,7 @@ Determine if an [link asio.reference.execution_context `execution_context`] cont template< typename ``[link asio.reference.Service Service]``> - friend bool has_service( + bool has_service( execution_context & e); @@ -96070,7 +94337,7 @@ Creates a service object and adds it to the [link asio.reference.execution_conte template< typename ``[link asio.reference.Service Service]``, typename... Args> - friend Service & make_service( + Service & make_service( execution_context & e, Args &&... args); @@ -96124,7 +94391,7 @@ Notify the [link asio.reference.execution_context `execution_context`] of a fork This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `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 [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. [heading Parameters] @@ -96152,16 +94419,16 @@ This function must not be called while any other [link asio.reference.execution_ 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); - } + 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); + } @@ -96206,13 +94473,13 @@ Obtain the service object corresponding to the given type. template< typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.execution_context.use_service.overload1 use_service]``( + Service & ``[link asio.reference.execution_context.use_service.overload1 use_service]``( execution_context & e); `` [''''»''' [link asio.reference.execution_context.use_service.overload1 more...]]`` template< typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.execution_context.use_service.overload2 use_service]``( + Service & ``[link asio.reference.execution_context.use_service.overload2 use_service]``( io_context & ioc); `` [''''»''' [link asio.reference.execution_context.use_service.overload2 more...]]`` @@ -96225,7 +94492,7 @@ Obtain the service object corresponding to the given type. template< typename ``[link asio.reference.Service Service]``> - friend Service & use_service( + Service & use_service( execution_context & e); @@ -96267,7 +94534,7 @@ Obtain the service object corresponding to the given type. template< typename ``[link asio.reference.Service Service]``> - friend Service & use_service( + Service & use_service( io_context & ioc); @@ -96697,9 +94964,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -96736,9 +95003,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -96955,7 +95222,7 @@ Operator to test if the executor contains a valid target. Compare two executors for inequality. - friend bool operator!=( + bool operator!=( const executor & a, const executor & b); @@ -97073,7 +95340,7 @@ Assignment operator to create a polymorphic wrapper for the specified executor. Compare two executors for equality. - friend bool operator==( + bool operator==( const executor & a, const executor & b); @@ -97111,9 +95378,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -97230,7 +95497,7 @@ If `*this` has a target type of type `T`, `typeid(T)`; otherwise, `typeid(void)` [indexterm2 asio.indexterm.executor.unspecified_bool_type..unspecified_bool_type..executor] - typedef void(*) unspecified_bool_type; + typedef void(* unspecified_bool_type; @@ -97448,7 +95715,7 @@ A call wrapper type to bind an executor of type `Executor` to an object of type [ [[link asio.reference.executor_binder.operator_lp__rp_ [*operator()]]] - [] + [Forwarding function call operator. ] ] [ @@ -97877,28 +96144,32 @@ Obtain the associated executor. [section:operator_lp__rp_ executor_binder::operator()] [indexterm2 asio.indexterm.executor_binder.operator_lp__rp_..operator()..executor_binder] +Forwarding function call operator. + template< typename... Args> - auto ``[link asio.reference.executor_binder.operator_lp__rp_.overload1 operator()]``( - Args && ...); + result_of_t< T(Args...)> ``[link asio.reference.executor_binder.operator_lp__rp_.overload1 operator()]``( + Args &&... args); `` [''''»''' [link asio.reference.executor_binder.operator_lp__rp_.overload1 more...]]`` template< typename... Args> - auto ``[link asio.reference.executor_binder.operator_lp__rp_.overload2 operator()]``( - Args && ...) const; + result_of_t< T(Args...)> ``[link asio.reference.executor_binder.operator_lp__rp_.overload2 operator()]``( + Args &&... args) const; `` [''''»''' [link asio.reference.executor_binder.operator_lp__rp_.overload2 more...]]`` [section:overload1 executor_binder::operator() (1 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...); + result_of_t< T(Args...)> operator()( + Args &&... args); @@ -97909,11 +96180,13 @@ Obtain the associated executor. [section:overload2 executor_binder::operator() (2 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...) const; + result_of_t< T(Args...)> operator()( + Args &&... args) const; @@ -98264,7 +96537,7 @@ Adapt a [link asio.overview.model.completion_tokens completion token] to specify template< typename CompletionToken> - constexpr as_single_t< typename decay< CompletionToken >::type > as_single( + constexpr as_single_t< decay_t< CompletionToken > > as_single( CompletionToken && completion_token); @@ -98295,6 +96568,13 @@ A [link asio.overview.model.completion_tokens completion token] adapter used to [table [[Name][Description]] + [ + + [[link asio.reference.experimental__as_single_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use as_single_t as its default completion token type. ] + + ] + [ [[link asio.reference.experimental__as_single_t__default_constructor_tag [*default_constructor_tag]]] @@ -98357,7 +96637,7 @@ Function helper to adapt an I/O object to use `as_single_t` as its default compl template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -98365,6 +96645,53 @@ Function helper to adapt an I/O object to use `as_single_t` as its default compl [endsect] + +[section:as_default_on_t experimental::as_single_t::as_default_on_t] + +[indexterm2 asio.indexterm.experimental__as_single_t.as_default_on_t..as_default_on_t..experimental::as_single_t] +Type alias to adapt an I/O object to use `as_single_t` as its default completion token type. + + + typedef typename T::template rebind_executor< executor_with_default< typename T::executor_type > >::other as_default_on_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__as_single_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify as_single_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__as_single_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. + [hr] + Convert the specified executor to the inner executor type, then use that to construct the adapted executor. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/experimental/as_single.hpp] + +['Convenience header: ]None + + +[endsect] + + [section:as_single_t experimental::as_single_t::as_single_t] [indexterm2 asio.indexterm.experimental__as_single_t.as_single_t..as_single_t..experimental::as_single_t] @@ -98468,7 +96795,8 @@ Adapts an executor to add the `as_single_t` completion token as the default. template< typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + struct executor_with_default : + public InnerExecutor [heading Types] @@ -98517,6 +96845,13 @@ Specify `as_single_t` as the default completion token type. [table [[Name][Description]] + [ + + [[link asio.reference.experimental__as_single_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use as_single_t as its default completion token type. ] + + ] + [ [[link asio.reference.experimental__as_single_t__default_constructor_tag [*default_constructor_tag]]] @@ -98593,7 +96928,7 @@ Convert the specified executor to the inner executor type, then use that to cons typename ``[link asio.reference.Executor1 OtherExecutor]``> ``[link asio.reference.experimental__as_single_t__executor_with_default.executor_with_default.overload2 executor_with_default]``( const OtherExecutor & ex, - typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, InnerExecutor >::value > = 0); `` [''''»''' [link asio.reference.experimental__as_single_t__executor_with_default.executor_with_default.overload2 more...]]`` @@ -98622,7 +96957,7 @@ Convert the specified executor to the inner executor type, then use that to cons typename ``[link asio.reference.Executor1 OtherExecutor]``> executor_with_default( const OtherExecutor & ex, - typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, InnerExecutor >::value > = 0); @@ -98634,60 +96969,60 @@ Convert the specified executor to the inner executor type, then use that to cons [endsect] -[section:experimental__awaitable_operators__operator__amp__amp_ experimental::awaitable_operators::operator &&] +[section:experimental__awaitable_operators__operator_amp__amp_ experimental::awaitable_operators::operator&&] -[indexterm1 asio.indexterm.experimental__awaitable_operators__operator__amp__amp_..experimental::awaitable_operators::operator &&] +[indexterm1 asio.indexterm.experimental__awaitable_operators__operator_amp__amp_..experimental::awaitable_operators::operator&&] Wait for both operations to succeed. template< typename ``[link asio.reference.Executor1 Executor]``> - awaitable< void, Executor > ``[link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload1 operator &&]``( + awaitable< void, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload1 operator&&]``( awaitable< void, Executor > t, awaitable< void, Executor > u); - `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload1 more...]]`` + `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload1 more...]]`` template< typename U, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< U, Executor > ``[link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload2 operator &&]``( + awaitable< U, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload2 operator&&]``( awaitable< void, Executor > t, awaitable< U, Executor > u); - `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload2 more...]]`` + `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload2 more...]]`` template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< T, Executor > ``[link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload3 operator &&]``( + awaitable< T, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload3 operator&&]``( awaitable< T, Executor > t, awaitable< void, Executor > u); - `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload3 more...]]`` + `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload3 more...]]`` template< typename T, typename U, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< std::tuple< T, U >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload4 operator &&]``( + awaitable< std::tuple< T, U >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload4 operator&&]``( awaitable< T, Executor > t, awaitable< U, Executor > u); - `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload4 more...]]`` + `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload4 more...]]`` template< typename... T, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< std::tuple< T..., std::monostate >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload5 operator &&]``( - awaitable< std::tuple< T...>, Executor > t, + awaitable< std::tuple< T..., std::monostate >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload5 operator&&]``( + awaitable< std::tuple< T... >, Executor > t, awaitable< void, Executor > u); - `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload5 more...]]`` + `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload5 more...]]`` template< typename... T, typename U, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< std::tuple< T..., U >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload6 operator &&]``( - awaitable< std::tuple< T...>, Executor > t, + awaitable< std::tuple< T..., U >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload6 operator&&]``( + awaitable< std::tuple< T... >, Executor > t, awaitable< U, Executor > u); - `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator__amp__amp_.overload6 more...]]`` + `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_amp__amp_.overload6 more...]]`` [heading Requirements] @@ -98696,7 +97031,7 @@ Wait for both operations to succeed. ['Convenience header: ]None -[section:overload1 experimental::awaitable_operators::operator && (1 of 6 overloads)] +[section:overload1 experimental::awaitable_operators::operator&& (1 of 6 overloads)] Wait for both operations to succeed. @@ -98704,7 +97039,7 @@ Wait for both operations to succeed. template< typename ``[link asio.reference.Executor1 Executor]``> - awaitable< void, Executor > operator &&( + awaitable< void, Executor > operator&&( awaitable< void, Executor > t, awaitable< void, Executor > u); @@ -98716,7 +97051,7 @@ If one operations fails, the other is cancelled as the AND-condition can no long -[section:overload2 experimental::awaitable_operators::operator && (2 of 6 overloads)] +[section:overload2 experimental::awaitable_operators::operator&& (2 of 6 overloads)] Wait for both operations to succeed. @@ -98725,7 +97060,7 @@ Wait for both operations to succeed. template< typename U, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< U, Executor > operator &&( + awaitable< U, Executor > operator&&( awaitable< void, Executor > t, awaitable< U, Executor > u); @@ -98737,7 +97072,7 @@ If one operations fails, the other is cancelled as the AND-condition can no long -[section:overload3 experimental::awaitable_operators::operator && (3 of 6 overloads)] +[section:overload3 experimental::awaitable_operators::operator&& (3 of 6 overloads)] Wait for both operations to succeed. @@ -98746,7 +97081,7 @@ Wait for both operations to succeed. template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< T, Executor > operator &&( + awaitable< T, Executor > operator&&( awaitable< T, Executor > t, awaitable< void, Executor > u); @@ -98758,7 +97093,7 @@ If one operations fails, the other is cancelled as the AND-condition can no long -[section:overload4 experimental::awaitable_operators::operator && (4 of 6 overloads)] +[section:overload4 experimental::awaitable_operators::operator&& (4 of 6 overloads)] Wait for both operations to succeed. @@ -98768,7 +97103,7 @@ Wait for both operations to succeed. typename T, typename U, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< std::tuple< T, U >, Executor > operator &&( + awaitable< std::tuple< T, U >, Executor > operator&&( awaitable< T, Executor > t, awaitable< U, Executor > u); @@ -98780,7 +97115,7 @@ If one operations fails, the other is cancelled as the AND-condition can no long -[section:overload5 experimental::awaitable_operators::operator && (5 of 6 overloads)] +[section:overload5 experimental::awaitable_operators::operator&& (5 of 6 overloads)] Wait for both operations to succeed. @@ -98789,8 +97124,8 @@ Wait for both operations to succeed. template< typename... T, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< std::tuple< T..., std::monostate >, Executor > operator &&( - awaitable< std::tuple< T...>, Executor > t, + awaitable< std::tuple< T..., std::monostate >, Executor > operator&&( + awaitable< std::tuple< T... >, Executor > t, awaitable< void, Executor > u); @@ -98801,7 +97136,7 @@ If one operations fails, the other is cancelled as the AND-condition can no long -[section:overload6 experimental::awaitable_operators::operator && (6 of 6 overloads)] +[section:overload6 experimental::awaitable_operators::operator&& (6 of 6 overloads)] Wait for both operations to succeed. @@ -98811,8 +97146,8 @@ Wait for both operations to succeed. typename... T, typename U, typename ``[link asio.reference.Executor1 Executor]``> - awaitable< std::tuple< T..., U >, Executor > operator &&( - awaitable< std::tuple< T...>, Executor > t, + awaitable< std::tuple< T..., U >, Executor > operator&&( + awaitable< std::tuple< T... >, Executor > t, awaitable< U, Executor > u); @@ -98866,7 +97201,7 @@ Wait for one operation to succeed. typename... T, typename ``[link asio.reference.Executor1 Executor]``> awaitable< std::variant< T..., std::monostate >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_pipe__pipe_.overload5 operator||]``( - awaitable< std::variant< T...>, Executor > t, + awaitable< std::variant< T... >, Executor > t, awaitable< void, Executor > u); `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_pipe__pipe_.overload5 more...]]`` @@ -98875,7 +97210,7 @@ Wait for one operation to succeed. typename U, typename ``[link asio.reference.Executor1 Executor]``> awaitable< std::variant< T..., U >, Executor > ``[link asio.reference.experimental__awaitable_operators__operator_pipe__pipe_.overload6 operator||]``( - awaitable< std::variant< T...>, Executor > t, + awaitable< std::variant< T... >, Executor > t, awaitable< U, Executor > u); `` [''''»''' [link asio.reference.experimental__awaitable_operators__operator_pipe__pipe_.overload6 more...]]`` @@ -98980,7 +97315,7 @@ Wait for one operation to succeed. typename... T, typename ``[link asio.reference.Executor1 Executor]``> awaitable< std::variant< T..., std::monostate >, Executor > operator||( - awaitable< std::variant< T...>, Executor > t, + awaitable< std::variant< T... >, Executor > t, awaitable< void, Executor > u); @@ -99002,7 +97337,7 @@ Wait for one operation to succeed. typename U, typename ``[link asio.reference.Executor1 Executor]``> awaitable< std::variant< T..., U >, Executor > operator||( - awaitable< std::variant< T...>, Executor > t, + awaitable< std::variant< T... >, Executor > t, awaitable< U, Executor > u); @@ -99134,6 +97469,16 @@ A channel for messages. [Try to send a number of messages without blocking. ] ] + [ + [[link asio.reference.experimental__basic_channel.try_send_n_via_dispatch [*try_send_n_via_dispatch]]] + [Try to send a number of messages without blocking, using dispatch semantics to call the receive operations' completion handlers. ] + ] + + [ + [[link asio.reference.experimental__basic_channel.try_send_via_dispatch [*try_send_via_dispatch]]] + [Try to send a message without blocking, using dispatch semantics to call the receive operation's completion handler. ] + ] + [ [[link asio.reference.experimental__basic_channel._basic_channel [*~basic_channel]] [destructor]] [Destructor. ] @@ -99146,45 +97491,45 @@ The [link asio.reference.experimental__basic_channel `experimental::basic_channe Unless customising the traits, applications will typically use the `experimental::channel` alias template. For example: void send_loop(int i, steady_timer& timer, - channel& ch) - { - if (i < 10) - { - timer.expires_after(chrono::seconds(1)); - timer.async_wait( - [i, &timer, &ch](error_code error) - { - if (!error) - { - ch.async_send(error_code(), i, - [i, &timer, &ch](error_code error) - { - if (!error) - { - send_loop(i + 1, timer, ch); - } - }); - } - }); - } - else - { - ch.close(); - } - } - - void receive_loop(channel& ch) - { - ch.async_receive( - [&ch](error_code error, int i) - { - if (!error) - { - std::cout << "Received " << i << "\n"; - receive_loop(ch); - } - }); - } + channel& ch) + { + if (i < 10) + { + timer.expires_after(chrono::seconds(1)); + timer.async_wait( + [i, &timer, &ch](error_code error) + { + if (!error) + { + ch.async_send(error_code(), i, + [i, &timer, &ch](error_code error) + { + if (!error) + { + send_loop(i + 1, timer, ch); + } + }); + } + }); + } + else + { + ch.close(); + } + } + + void receive_loop(channel& ch) + { + ch.async_receive( + [&ch](error_code error, int i) + { + if (!error) + { + std::cout << "Received " << i << "\n"; + receive_loop(ch); + } + }); + } @@ -99248,7 +97593,7 @@ Asynchronously send a message. - void(asio::error_code) + void(asio::error_code) @@ -99279,7 +97624,7 @@ Construct and open a [link asio.reference.experimental__basic_channel `experimen ``[link asio.reference.experimental__basic_channel.basic_channel.overload2 basic_channel]``( ExecutionContext & context, std::size_t max_buffer_size = 0, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.experimental__basic_channel.basic_channel.overload2 more...]]`` @@ -99293,8 +97638,8 @@ Move-construct a [link asio.reference.experimental__basic_channel `experimental: template< typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.experimental__basic_channel.basic_channel.overload4 basic_channel]``( - basic_channel< Executor1, Traits, Signatures...> && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + basic_channel< Executor1, Traits, Signatures... > && other, + constraint_t< is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.experimental__basic_channel.basic_channel.overload4 more...]]`` @@ -99341,7 +97686,7 @@ Construct and open a [link asio.reference.experimental__basic_channel `experimen basic_channel( ExecutionContext & context, std::size_t max_buffer_size = 0, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates and opens a channel. @@ -99390,7 +97735,7 @@ This constructor moves a channel from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_channel(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_channel(const executor_type&)` constructor. @@ -99408,8 +97753,8 @@ Move-construct a [link asio.reference.experimental__basic_channel `experimental: template< typename ``[link asio.reference.Executor1 Executor1]``> basic_channel( - basic_channel< Executor1, Traits, Signatures...> && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + basic_channel< Executor1, Traits, Signatures... > && other, + constraint_t< is_convertible< Executor1, Executor >::value > = 0); This constructor moves a channel from one object to another. @@ -99542,8 +97887,8 @@ Move-assign a [link asio.reference.experimental__basic_channel `experimental::ba template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_channel & >::type ``[link asio.reference.experimental__basic_channel.operator_eq_.overload2 operator=]``( - basic_channel< Executor1, Traits, Signatures...> && other); + constraint_t< is_convertible< Executor1, Executor >::value, basic_channel & > ``[link asio.reference.experimental__basic_channel.operator_eq_.overload2 operator=]``( + basic_channel< Executor1, Traits, Signatures... > && other); `` [''''»''' [link asio.reference.experimental__basic_channel.operator_eq_.overload2 more...]]`` @@ -99589,8 +97934,8 @@ Move-assign a [link asio.reference.experimental__basic_channel `experimental::ba template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_channel & >::type operator=( - basic_channel< Executor1, Traits, Signatures...> && other); + constraint_t< is_convertible< Executor1, Executor >::value, basic_channel & > operator=( + basic_channel< Executor1, Traits, Signatures... > && other); This assignment operator moves a channel from one object to another. Cancels any outstanding asynchronous operations associated with the target object. @@ -99653,7 +97998,7 @@ Reset the channel to its initial state. The traits type associated with the channel. - typedef Traits::template rebind< Signatures...>::other traits_type; + typedef Traits::template rebind< Signatures... >::other traits_type; @@ -99741,6 +98086,61 @@ The number of messages that were sent. +[endsect] + + + +[section:try_send_n_via_dispatch experimental::basic_channel::try_send_n_via_dispatch] + +[indexterm2 asio.indexterm.experimental__basic_channel.try_send_n_via_dispatch..try_send_n_via_dispatch..experimental::basic_channel] +Try to send a number of messages without blocking, using dispatch semantics to call the receive operations' completion handlers. + + + template< + typename... Args> + std::size_t try_send_n_via_dispatch( + std::size_t count, + Args &&... args); + + +The receive operations' completion handlers may be called from inside this function. + + +[heading Return Value] + +The number of messages that were sent. + + + + +[endsect] + + + +[section:try_send_via_dispatch experimental::basic_channel::try_send_via_dispatch] + +[indexterm2 asio.indexterm.experimental__basic_channel.try_send_via_dispatch..try_send_via_dispatch..experimental::basic_channel] +Try to send a message without blocking, using dispatch semantics to call the receive operation's completion handler. + + + template< + typename... Args> + bool try_send_via_dispatch( + Args &&... args); + + +Fails if the buffer is full and there are no waiting receive operations. + +The receive operation's completion handler may be called from inside this function. + + +[heading Return Value] + +`true` on success, `false` on failure. + + + + [endsect] @@ -99800,7 +98200,7 @@ Rebinds the channel type to another executor. The channel type when rebound to the specified executor. - typedef basic_channel< Executor1, Traits, Signatures...> other; + typedef basic_channel< Executor1, Traits, Signatures... > other; [heading Types] @@ -99908,6 +98308,16 @@ The channel type when rebound to the specified executor. [Try to send a number of messages without blocking. ] ] + [ + [[link asio.reference.experimental__basic_channel.try_send_n_via_dispatch [*try_send_n_via_dispatch]]] + [Try to send a number of messages without blocking, using dispatch semantics to call the receive operations' completion handlers. ] + ] + + [ + [[link asio.reference.experimental__basic_channel.try_send_via_dispatch [*try_send_via_dispatch]]] + [Try to send a message without blocking, using dispatch semantics to call the receive operation's completion handler. ] + ] + [ [[link asio.reference.experimental__basic_channel._basic_channel [*~basic_channel]] [destructor]] [Destructor. ] @@ -99920,45 +98330,45 @@ The [link asio.reference.experimental__basic_channel `experimental::basic_channe Unless customising the traits, applications will typically use the `experimental::channel` alias template. For example: void send_loop(int i, steady_timer& timer, - channel& ch) - { - if (i < 10) - { - timer.expires_after(chrono::seconds(1)); - timer.async_wait( - [i, &timer, &ch](error_code error) - { - if (!error) - { - ch.async_send(error_code(), i, - [i, &timer, &ch](error_code error) - { - if (!error) - { - send_loop(i + 1, timer, ch); - } - }); - } - }); - } - else - { - ch.close(); - } - } - - void receive_loop(channel& ch) - { - ch.async_receive( - [&ch](error_code error, int i) - { - if (!error) - { - std::cout << "Received " << i << "\n"; - receive_loop(ch); - } - }); - } + channel& ch) + { + if (i < 10) + { + timer.expires_after(chrono::seconds(1)); + timer.async_wait( + [i, &timer, &ch](error_code error) + { + if (!error) + { + ch.async_send(error_code(), i, + [i, &timer, &ch](error_code error) + { + if (!error) + { + send_loop(i + 1, timer, ch); + } + }); + } + }); + } + else + { + ch.close(); + } + } + + void receive_loop(channel& ch) + { + ch.async_receive( + [&ch](error_code error, int i) + { + if (!error) + { + std::cout << "Received " << i << "\n"; + receive_loop(ch); + } + }); + } @@ -100106,6 +98516,16 @@ A channel for messages. [Try to send a number of messages without blocking. ] ] + [ + [[link asio.reference.experimental__basic_concurrent_channel.try_send_n_via_dispatch [*try_send_n_via_dispatch]]] + [Try to send a number of messages without blocking, using dispatch semantics to call the receive operations' completion handlers. ] + ] + + [ + [[link asio.reference.experimental__basic_concurrent_channel.try_send_via_dispatch [*try_send_via_dispatch]]] + [Try to send a message without blocking, using dispatch semantics to call the receive operation's completion handler. ] + ] + [ [[link asio.reference.experimental__basic_concurrent_channel._basic_concurrent_channel [*~basic_concurrent_channel]] [destructor]] [Destructor. ] @@ -100118,45 +98538,45 @@ The [link asio.reference.experimental__basic_concurrent_channel `experimental::b Unless customising the traits, applications will typically use the `experimental::concurrent_channel` alias template. For example: void send_loop(int i, steady_timer& timer, - concurrent_channel& ch) - { - if (i < 10) - { - timer.expires_after(chrono::seconds(1)); - timer.async_wait( - [i, &timer, &ch](error_code error) - { - if (!error) - { - ch.async_send(error_code(), i, - [i, &timer, &ch](error_code error) - { - if (!error) - { - send_loop(i + 1, timer, ch); - } - }); - } - }); - } - else - { - ch.close(); - } - } - - void receive_loop(concurent_channel& ch) - { - ch.async_receive( - [&ch](error_code error, int i) - { - if (!error) - { - std::cout << "Received " << i << "\n"; - receive_loop(ch); - } - }); - } + concurrent_channel& ch) + { + if (i < 10) + { + timer.expires_after(chrono::seconds(1)); + timer.async_wait( + [i, &timer, &ch](error_code error) + { + if (!error) + { + ch.async_send(error_code(), i, + [i, &timer, &ch](error_code error) + { + if (!error) + { + send_loop(i + 1, timer, ch); + } + }); + } + }); + } + else + { + ch.close(); + } + } + + void receive_loop(concurent_channel& ch) + { + ch.async_receive( + [&ch](error_code error, int i) + { + if (!error) + { + std::cout << "Received " << i << "\n"; + receive_loop(ch); + } + }); + } @@ -100232,7 +98652,7 @@ Construct and open a [link asio.reference.experimental__basic_concurrent_channel ``[link asio.reference.experimental__basic_concurrent_channel.basic_concurrent_channel.overload2 basic_concurrent_channel]``( ExecutionContext & context, std::size_t max_buffer_size = 0, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.experimental__basic_concurrent_channel.basic_concurrent_channel.overload2 more...]]`` @@ -100246,8 +98666,8 @@ Move-construct a [link asio.reference.experimental__basic_concurrent_channel `ex template< typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.experimental__basic_concurrent_channel.basic_concurrent_channel.overload4 basic_concurrent_channel]``( - basic_concurrent_channel< Executor1, Traits, Signatures...> && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + basic_concurrent_channel< Executor1, Traits, Signatures... > && other, + constraint_t< is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.experimental__basic_concurrent_channel.basic_concurrent_channel.overload4 more...]]`` @@ -100294,7 +98714,7 @@ Construct and open a [link asio.reference.experimental__basic_concurrent_channel basic_concurrent_channel( ExecutionContext & context, std::size_t max_buffer_size = 0, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates and opens a channel. @@ -100361,8 +98781,8 @@ Move-construct a [link asio.reference.experimental__basic_concurrent_channel `ex template< typename ``[link asio.reference.Executor1 Executor1]``> basic_concurrent_channel( - basic_concurrent_channel< Executor1, Traits, Signatures...> && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + basic_concurrent_channel< Executor1, Traits, Signatures... > && other, + constraint_t< is_convertible< Executor1, Executor >::value > = 0); This constructor moves a channel from one object to another. @@ -100495,8 +98915,8 @@ Move-assign a [link asio.reference.experimental__basic_concurrent_channel `exper template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_concurrent_channel & >::type ``[link asio.reference.experimental__basic_concurrent_channel.operator_eq_.overload2 operator=]``( - basic_concurrent_channel< Executor1, Traits, Signatures...> && other); + constraint_t< is_convertible< Executor1, Executor >::value, basic_concurrent_channel & > ``[link asio.reference.experimental__basic_concurrent_channel.operator_eq_.overload2 operator=]``( + basic_concurrent_channel< Executor1, Traits, Signatures... > && other); `` [''''»''' [link asio.reference.experimental__basic_concurrent_channel.operator_eq_.overload2 more...]]`` @@ -100542,8 +98962,8 @@ Move-assign a [link asio.reference.experimental__basic_concurrent_channel `exper template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_concurrent_channel & >::type operator=( - basic_concurrent_channel< Executor1, Traits, Signatures...> && other); + constraint_t< is_convertible< Executor1, Executor >::value, basic_concurrent_channel & > operator=( + basic_concurrent_channel< Executor1, Traits, Signatures... > && other); This assignment operator moves a channel from one object to another. Cancels any outstanding asynchronous operations associated with the target object. @@ -100606,7 +99026,7 @@ Reset the channel to its initial state. The traits type associated with the channel. - typedef Traits::template rebind< Signatures...>::other traits_type; + typedef Traits::template rebind< Signatures... >::other traits_type; @@ -100694,6 +99114,61 @@ The number of messages that were sent. +[endsect] + + + +[section:try_send_n_via_dispatch experimental::basic_concurrent_channel::try_send_n_via_dispatch] + +[indexterm2 asio.indexterm.experimental__basic_concurrent_channel.try_send_n_via_dispatch..try_send_n_via_dispatch..experimental::basic_concurrent_channel] +Try to send a number of messages without blocking, using dispatch semantics to call the receive operations' completion handlers. + + + template< + typename... Args> + std::size_t try_send_n_via_dispatch( + std::size_t count, + Args &&... args); + + +The receive operations' completion handlers may be called from inside this function. + + +[heading Return Value] + +The number of messages that were sent. + + + + +[endsect] + + + +[section:try_send_via_dispatch experimental::basic_concurrent_channel::try_send_via_dispatch] + +[indexterm2 asio.indexterm.experimental__basic_concurrent_channel.try_send_via_dispatch..try_send_via_dispatch..experimental::basic_concurrent_channel] +Try to send a message without blocking, using dispatch semantics to call the receive operation's completion handler. + + + template< + typename... Args> + bool try_send_via_dispatch( + Args &&... args); + + +Fails if the buffer is full and there are no waiting receive operations. + +The receive operation's completion handler may be called from inside this function. + + +[heading Return Value] + +`true` on success, `false` on failure. + + + + [endsect] @@ -100753,7 +99228,7 @@ Rebinds the channel type to another executor. The channel type when rebound to the specified executor. - typedef basic_concurrent_channel< Executor1, Traits, Signatures...> other; + typedef basic_concurrent_channel< Executor1, Traits, Signatures... > other; [heading Types] @@ -100861,6 +99336,16 @@ The channel type when rebound to the specified executor. [Try to send a number of messages without blocking. ] ] + [ + [[link asio.reference.experimental__basic_concurrent_channel.try_send_n_via_dispatch [*try_send_n_via_dispatch]]] + [Try to send a number of messages without blocking, using dispatch semantics to call the receive operations' completion handlers. ] + ] + + [ + [[link asio.reference.experimental__basic_concurrent_channel.try_send_via_dispatch [*try_send_via_dispatch]]] + [Try to send a message without blocking, using dispatch semantics to call the receive operation's completion handler. ] + ] + [ [[link asio.reference.experimental__basic_concurrent_channel._basic_concurrent_channel [*~basic_concurrent_channel]] [destructor]] [Destructor. ] @@ -100873,45 +99358,45 @@ The [link asio.reference.experimental__basic_concurrent_channel `experimental::b Unless customising the traits, applications will typically use the `experimental::concurrent_channel` alias template. For example: void send_loop(int i, steady_timer& timer, - concurrent_channel& ch) - { - if (i < 10) - { - timer.expires_after(chrono::seconds(1)); - timer.async_wait( - [i, &timer, &ch](error_code error) - { - if (!error) - { - ch.async_send(error_code(), i, - [i, &timer, &ch](error_code error) - { - if (!error) - { - send_loop(i + 1, timer, ch); - } - }); - } - }); - } - else - { - ch.close(); - } - } - - void receive_loop(concurent_channel& ch) - { - ch.async_receive( - [&ch](error_code error, int i) - { - if (!error) - { - std::cout << "Received " << i << "\n"; - receive_loop(ch); - } - }); - } + concurrent_channel& ch) + { + if (i < 10) + { + timer.expires_after(chrono::seconds(1)); + timer.async_wait( + [i, &timer, &ch](error_code error) + { + if (!error) + { + ch.async_send(error_code(), i, + [i, &timer, &ch](error_code error) + { + if (!error) + { + send_loop(i + 1, timer, ch); + } + }); + } + }); + } + else + { + ch.close(); + } + } + + void receive_loop(concurent_channel& ch) + { + ch.async_receive( + [&ch](error_code error, int i) + { + if (!error) + { + std::cout << "Received " << i << "\n"; + receive_loop(ch); + } + }); + } @@ -100939,6 +99424,41 @@ The [link asio.reference.experimental__basic_concurrent_channel `experimental::b [endsect] + +[section:experimental__channel experimental::channel] + +[indexterm1 asio.indexterm.experimental__channel..experimental::channel] + +Template type alias for common use of channel. + + + typedef typename detail::channel_type< ExecutorOrSignature >::template inner< Signatures... >::type channel; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__detail__channel_type__inner [*inner]]] + [] + + ] + +] + + +[heading Requirements] + +['Header: ][^asio/experimental/channel.hpp] + +['Convenience header: ]None + + +[endsect] + + [section:experimental__channel_traits experimental::channel_traits] [indexterm1 asio.indexterm.experimental__channel_traits..experimental::channel_traits] @@ -101241,43 +99761,43 @@ The following example illustrates manual error handling and explicit checks for template - auto async_echo(tcp::socket& socket, - CompletionToken&& token) - { - return asio::async_initiate< - CompletionToken, void(std::error_code)>( - asio::experimental::co_composed( - [](auto state, tcp::socket& socket) -> void - { - state.reset_cancellation_state( - asio::enable_terminal_cancellation()); - - while (!state.cancelled()) - { - char data[1024]; - auto [e1, n1] = - co_await socket.async_read_some( - asio::buffer(data), - asio::as_tuple(asio::deferred)); - - if (e1) - co_yield state.complete(e1); - - if (!!state.cancelled()) - co_yield state.complete( - make_error_code(asio::error::operation_aborted)); - - auto [e2, n2] = - co_await asio::async_write(socket, - asio::buffer(data, n1), - asio::as_tuple(asio::deferred)); - - if (e2) - co_yield state.complete(e2); - } - }, socket), - token, std::ref(socket)); - } + auto async_echo(tcp::socket& socket, + CompletionToken&& token) + { + return asio::async_initiate< + CompletionToken, void(std::error_code)>( + asio::experimental::co_composed( + [](auto state, tcp::socket& socket) -> void + { + state.reset_cancellation_state( + asio::enable_terminal_cancellation()); + + while (!state.cancelled()) + { + char data[1024]; + auto [e1, n1] = + co_await socket.async_read_some( + asio::buffer(data), + asio::as_tuple(asio::deferred)); + + if (e1) + co_yield state.complete(e1); + + if (!!state.cancelled()) + co_yield state.complete( + make_error_code(asio::error::operation_aborted)); + + auto [e2, n2] = + co_await asio::async_write(socket, + asio::buffer(data, n1), + asio::as_tuple(asio::deferred)); + + if (e2) + co_yield state.complete(e2); + } + }, socket), + token, std::ref(socket)); + } @@ -101287,38 +99807,38 @@ This next example shows exception-based error handling and implicit checks for c template - auto async_echo(tcp::socket& socket, - CompletionToken&& token) - { - return asio::async_initiate< - CompletionToken, void(std::error_code)>( - asio::experimental::co_composed< - void(std::error_code)>( - [](auto state, tcp::socket& socket) -> void - { - try - { - state.throw_if_cancelled(true); - state.reset_cancellation_state( - asio::enable_terminal_cancellation()); - - for (;;) - { - char data[1024]; - std::size_t n = co_await socket.async_read_some( - asio::buffer(data), asio::deferred); - - co_await asio::async_write(socket, - asio::buffer(data, n), asio::deferred); - } - } - catch (const std::system_error& e) - { - co_return {e.code()}; - } - }, socket), - token, std::ref(socket)); - } + auto async_echo(tcp::socket& socket, + CompletionToken&& token) + { + return asio::async_initiate< + CompletionToken, void(std::error_code)>( + asio::experimental::co_composed< + void(std::error_code)>( + [](auto state, tcp::socket& socket) -> void + { + try + { + state.throw_if_cancelled(true); + state.reset_cancellation_state( + asio::enable_terminal_cancellation()); + + for (;;) + { + char data[1024]; + std::size_t n = co_await socket.async_read_some( + asio::buffer(data), asio::deferred); + + co_await asio::async_write(socket, + asio::buffer(data, n), asio::deferred); + } + } + catch (const std::system_error& e) + { + co_return {e.code()}; + } + }, socket), + token, std::ref(socket)); + } @@ -101641,6 +100161,41 @@ Implementation defined [endsect] + +[section:experimental__concurrent_channel experimental::concurrent_channel] + +[indexterm1 asio.indexterm.experimental__concurrent_channel..experimental::concurrent_channel] + +Template type alias for common use of channel. + + + typedef typename detail::concurrent_channel_type< ExecutorOrSignature >::template inner< Signatures... >::type concurrent_channel; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__detail__concurrent_channel_type__inner [*inner]]] + [] + + ] + +] + + +[heading Requirements] + +['Header: ][^asio/experimental/concurrent_channel.hpp] + +['Convenience header: ]None + + +[endsect] + + [section:experimental__coro experimental::coro] [indexterm1 asio.indexterm.experimental__coro..experimental::coro] @@ -101657,6 +100212,89 @@ The main type of a resumable coroutine. struct coro +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__coro.allocator_type [*allocator_type]]] + [The allocator type. ] + + ] + + [ + + [[link asio.reference.experimental__coro.completion_handler [*completion_handler]]] + [Completion handler type used by async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro.error_type [*error_type]]] + [The error type of the coroutine. Void for noexcept. ] + + ] + + [ + + [[link asio.reference.experimental__coro.executor_type [*executor_type]]] + [The executor type. ] + + ] + + [ + + [[link asio.reference.experimental__coro.input_type [*input_type]]] + [The value that can be passed into a symmetrical cororoutine. void if asymmetrical. ] + + ] + + [ + + [[link asio.reference.experimental__coro.promise_type [*promise_type]]] + [The internal promise-type of the coroutine. ] + + ] + + [ + + [[link asio.reference.experimental__coro.result_type [*result_type]]] + [The type received by a co_await or async_resume. Its a combination of yield and return. ] + + ] + + [ + + [[link asio.reference.experimental__coro.return_type [*return_type]]] + [The type that can be passed out through a co_return. ] + + ] + + [ + + [[link asio.reference.experimental__coro.signature_type [*signature_type]]] + [The signature used by the async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro.traits [*traits]]] + [The traits of the coroutine. See asio::experimental::coro_traits for details. ] + + ] + + [ + + [[link asio.reference.experimental__coro.yield_type [*yield_type]]] + [The type that can be passed out through a co_yield. ] + + ] + +] + [heading Member Functions] [table [[Name][Description]] @@ -101736,6 +100374,27 @@ Template parameter `Yield` specifies type or signature used by co\_yield, `Retur ['Convenience header: ]None + +[section:allocator_type experimental::coro::allocator_type] + +[indexterm2 asio.indexterm.experimental__coro.allocator_type..allocator_type..experimental::coro] +The allocator type. + + + typedef Allocator allocator_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + [section:async_resume experimental::coro::async_resume] [indexterm2 asio.indexterm.experimental__coro.async_resume..async_resume..experimental::coro] @@ -101744,7 +100403,7 @@ Resume the coroutine. template< typename CompletionToken> - requires std::is_void_v< input_type > auto ``[link asio.reference.experimental__coro.async_resume.overload1 async_resume]``( + auto ``[link asio.reference.experimental__coro.async_resume.overload1 async_resume]``( CompletionToken && token); `` [''''»''' [link asio.reference.experimental__coro.async_resume.overload1 more...]]`` @@ -101765,7 +100424,7 @@ Resume the coroutine. template< typename CompletionToken> - requires std::is_void_v< input_type > auto async_resume( + auto async_resume( CompletionToken && token); @@ -101838,6 +100497,27 @@ This overload is only available for coroutines with an input value. [endsect] + +[section:completion_handler experimental::coro::completion_handler] + +[indexterm2 asio.indexterm.experimental__coro.completion_handler..completion_handler..experimental::coro] +Completion handler type used by async\_resume. + + + typedef typename traits::completion_handler completion_handler; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + [section:coro experimental::coro::coro] [indexterm2 asio.indexterm.experimental__coro.coro..coro..experimental::coro] @@ -101906,6 +100586,48 @@ Move constructor. [endsect] +[section:error_type experimental::coro::error_type] + +[indexterm2 asio.indexterm.experimental__coro.error_type..error_type..experimental::coro] +The error type of the coroutine. Void for noexcept. + + + typedef typename traits::error_type error_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:executor_type experimental::coro::executor_type] + +[indexterm2 asio.indexterm.experimental__coro.executor_type..executor_type..experimental::coro] +The executor type. + + + typedef Executor executor_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:get_allocator experimental::coro::get_allocator] [indexterm2 asio.indexterm.experimental__coro.get_allocator..get_allocator..experimental::coro] @@ -101934,6 +100656,27 @@ Get the used executor. +[section:input_type experimental::coro::input_type] + +[indexterm2 asio.indexterm.experimental__coro.input_type..input_type..experimental::coro] +The value that can be passed into a symmetrical cororoutine. `void` if asymmetrical. + + + typedef typename traits::input_type input_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:is_noexcept experimental::coro::is_noexcept] [indexterm2 asio.indexterm.experimental__coro.is_noexcept..is_noexcept..experimental::coro] @@ -102019,10 +100762,10 @@ An awaitable handle. - coro push_values(coro c) - { - std::optional res = co_await c(42); - } + coro push_values(coro c) + { + std::optional res = co_await c(42); + } @@ -102076,6 +100819,200 @@ Move assignment. [endsect] +[section:promise_type experimental::coro::promise_type] + +[indexterm2 asio.indexterm.experimental__coro.promise_type..promise_type..experimental::coro] +The internal promise-type of the coroutine. + + + typedef detail::coro_promise< Yield, Return, Executor, Allocator > promise_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:result_type experimental::coro::result_type] + +[indexterm2 asio.indexterm.experimental__coro.result_type..result_type..experimental::coro] +The type received by a co\_await or async\_resume. Its a combination of yield and return. + + + typedef typename traits::result_type result_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:return_type experimental::coro::return_type] + +[indexterm2 asio.indexterm.experimental__coro.return_type..return_type..experimental::coro] +The type that can be passed out through a co\_return. + + + typedef typename traits::return_type return_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:signature_type experimental::coro::signature_type] + +[indexterm2 asio.indexterm.experimental__coro.signature_type..signature_type..experimental::coro] +The signature used by the async\_resume. + + + typedef typename traits::signature_type signature_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:traits experimental::coro::traits] + +[indexterm2 asio.indexterm.experimental__coro.traits..traits..experimental::coro] +The traits of the coroutine. See [link asio.reference.experimental__coro_traits `experimental::coro_traits`] for details. + + + typedef coro_traits< Yield, Return, Executor > traits; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__coro_traits.completion_handler [*completion_handler]]] + [Completion handler type used by async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.error_type [*error_type]]] + [The error type of the coroutine. void for noexcept. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.input_type [*input_type]]] + [The value that can be passed into a symmetrical cororoutine. void if asymmetrical. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.result_type [*result_type]]] + [The type received by a co_await or async_resume. It's a combination of yield and return. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.return_type [*return_type]]] + [The type that can be passed out through a co_return. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.signature_type [*signature_type]]] + [The signature used by the async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.yield_type [*yield_type]]] + [The type that can be passed out through a co_yield. ] + + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__coro_traits.is_noexcept [*is_noexcept]] [static]] + [Whether or not the coroutine is noexcept. ] + ] + +] + +Template parameter `Yield` specifies type or signature used by co\_yield, `Return` specifies the type used for co\_return, and `Executor` specifies the underlying executor type. + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:yield_type experimental::coro::yield_type] + +[indexterm2 asio.indexterm.experimental__coro.yield_type..yield_type..experimental::coro] +The type that can be passed out through a co\_yield. + + + typedef typename traits::yield_type yield_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:_coro experimental::coro::~coro] [indexterm2 asio.indexterm.experimental__coro._coro..~coro..experimental::coro] @@ -102114,6 +101051,61 @@ The traits describing the resumable coroutine behaviour. struct coro_traits +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__coro_traits.completion_handler [*completion_handler]]] + [Completion handler type used by async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.error_type [*error_type]]] + [The error type of the coroutine. void for noexcept. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.input_type [*input_type]]] + [The value that can be passed into a symmetrical cororoutine. void if asymmetrical. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.result_type [*result_type]]] + [The type received by a co_await or async_resume. It's a combination of yield and return. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.return_type [*return_type]]] + [The type that can be passed out through a co_return. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.signature_type [*signature_type]]] + [The signature used by the async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro_traits.yield_type [*yield_type]]] + [The type that can be passed out through a co_yield. ] + + ] + +] + [heading Data Members] [table [[Name][Description]] @@ -102134,6 +101126,69 @@ Template parameter `Yield` specifies type or signature used by co\_yield, `Retur ['Convenience header: ]None +[section:completion_handler experimental::coro_traits::completion_handler] + +[indexterm2 asio.indexterm.experimental__coro_traits.completion_handler..completion_handler..experimental::coro_traits] +Completion handler type used by async\_resume. + + + typedef argument_dependent completion_handler; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:error_type experimental::coro_traits::error_type] + +[indexterm2 asio.indexterm.experimental__coro_traits.error_type..error_type..experimental::coro_traits] +The error type of the coroutine. `void` for noexcept. + + + typedef argument_dependent error_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:input_type experimental::coro_traits::input_type] + +[indexterm2 asio.indexterm.experimental__coro_traits.input_type..input_type..experimental::coro_traits] +The value that can be passed into a symmetrical cororoutine. `void` if asymmetrical. + + + typedef argument_dependent input_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:is_noexcept experimental::coro_traits::is_noexcept] [indexterm2 asio.indexterm.experimental__coro_traits.is_noexcept..is_noexcept..experimental::coro_traits] @@ -102148,6 +101203,90 @@ Whether or not the coroutine is noexcept. +[section:result_type experimental::coro_traits::result_type] + +[indexterm2 asio.indexterm.experimental__coro_traits.result_type..result_type..experimental::coro_traits] +The type received by a co\_await or async\_resume. It's a combination of yield and return. + + + typedef argument_dependent result_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:return_type experimental::coro_traits::return_type] + +[indexterm2 asio.indexterm.experimental__coro_traits.return_type..return_type..experimental::coro_traits] +The type that can be passed out through a co\_return. + + + typedef argument_dependent return_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:signature_type experimental::coro_traits::signature_type] + +[indexterm2 asio.indexterm.experimental__coro_traits.signature_type..signature_type..experimental::coro_traits] +The signature used by the async\_resume. + + + typedef argument_dependent signature_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:yield_type experimental::coro_traits::yield_type] + +[indexterm2 asio.indexterm.experimental__coro_traits.yield_type..yield_type..experimental::coro_traits] +The type that can be passed out through a co\_yield. + + + typedef argument_dependent yield_type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/coro_traits.hpp] + +['Convenience header: ]None + + +[endsect] + + + [endsect] @@ -102244,6 +101383,184 @@ Whether or not the coroutine is noexcept. [endsect] + +[section:experimental__generator experimental::generator] + +[indexterm1 asio.indexterm.experimental__generator..experimental::generator] + +A generator is a coro that returns void and yields value. + + + typedef coro< T, void, Executor, Allocator > generator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__coro.allocator_type [*allocator_type]]] + [The allocator type. ] + + ] + + [ + + [[link asio.reference.experimental__coro.completion_handler [*completion_handler]]] + [Completion handler type used by async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro.error_type [*error_type]]] + [The error type of the coroutine. Void for noexcept. ] + + ] + + [ + + [[link asio.reference.experimental__coro.executor_type [*executor_type]]] + [The executor type. ] + + ] + + [ + + [[link asio.reference.experimental__coro.input_type [*input_type]]] + [The value that can be passed into a symmetrical cororoutine. void if asymmetrical. ] + + ] + + [ + + [[link asio.reference.experimental__coro.promise_type [*promise_type]]] + [The internal promise-type of the coroutine. ] + + ] + + [ + + [[link asio.reference.experimental__coro.result_type [*result_type]]] + [The type received by a co_await or async_resume. Its a combination of yield and return. ] + + ] + + [ + + [[link asio.reference.experimental__coro.return_type [*return_type]]] + [The type that can be passed out through a co_return. ] + + ] + + [ + + [[link asio.reference.experimental__coro.signature_type [*signature_type]]] + [The signature used by the async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro.traits [*traits]]] + [The traits of the coroutine. See asio::experimental::coro_traits for details. ] + + ] + + [ + + [[link asio.reference.experimental__coro.yield_type [*yield_type]]] + [The type that can be passed out through a co_yield. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__coro.async_resume [*async_resume]]] + [Resume the coroutine. ] + ] + + [ + [[link asio.reference.experimental__coro.coro [*coro]] [constructor]] + [The default constructor, gives an invalid coroutine. + [hr] + Move constructor. + [hr] + ] + ] + + [ + [[link asio.reference.experimental__coro.get_allocator [*get_allocator]]] + [Get the used allocator. ] + ] + + [ + [[link asio.reference.experimental__coro.get_executor [*get_executor]]] + [Get the used executor. ] + ] + + [ + [[link asio.reference.experimental__coro.is_open [*is_open]]] + [Check whether the coroutine is open, i.e. can be resumed. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_bool [*operator bool]]] + [Check whether the coroutine is open, i.e. can be resumed. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_co_await [*operator co_await]]] + [Operator used for coroutines without input value. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_lp__rp_ [*operator()]]] + [Operator used for coroutines with input value. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_eq_ [*operator=]]] + [Move assignment. ] + ] + + [ + [[link asio.reference.experimental__coro._coro [*~coro]] [destructor]] + [Destructor. Destroys the coroutine, if it holds a valid one. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__coro.is_noexcept [*is_noexcept]] [static]] + [Whether or not the coroutine is noexcept. ] + ] + +] + +Template parameter `Yield` specifies type or signature used by co\_yield, `Return` specifies the type used for co\_return, and `Executor` specifies the underlying executor type. + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + [section:experimental__is_async_operation_range experimental::is_async_operation_range] [indexterm1 asio.indexterm.experimental__is_async_operation_range..experimental::is_async_operation_range] @@ -102299,7 +101616,8 @@ The value member is true if the type may be used as a range of asynchronous oper template< typename T> - struct is_promise + struct is_promise : + public std::false_type [heading Requirements] @@ -102311,15 +101629,16 @@ The value member is true if the type may be used as a range of asynchronous oper [endsect] -[section:experimental__is_promise_lt__promise_lt__Ts_ellipsis__gt__gt_ experimental::is_promise< promise< Ts...>>] +[section:experimental__is_promise_lt__promise_lt__Ts_ellipsis___gt___gt_ experimental::is_promise< promise< Ts... > >] -[indexterm1 asio.indexterm.experimental__is_promise_lt__promise_lt__Ts_ellipsis__gt__gt_..experimental::is_promise< promise< Ts\.\.\.>>] +[indexterm1 asio.indexterm.experimental__is_promise_lt__promise_lt__Ts_ellipsis___gt___gt_..experimental::is_promise< promise< Ts\.\.\. > >] template< - typename... Ts> - struct is_promise< promise< Ts...>> + typename ... Ts> + struct is_promise< promise< Ts... > > : + public std::true_type [heading Requirements] @@ -102337,7 +101656,7 @@ The value member is true if the type may be used as a range of asynchronous oper [indexterm1 asio.indexterm.experimental__is_promise_v..experimental::is_promise_v] - constexpr bool is_promise_v =is_promise::value; + constexpr bool is_promise_v = is_promise::value; [heading Requirements] @@ -102358,25 +101677,25 @@ Create a group of operations that may be launched in parallel. template< typename... Ops> - parallel_group< Ops...> ``[link asio.reference.experimental__make_parallel_group.overload1 make_parallel_group]``( + parallel_group< Ops... > ``[link asio.reference.experimental__make_parallel_group.overload1 make_parallel_group]``( Ops... ops); `` [''''»''' [link asio.reference.experimental__make_parallel_group.overload1 more...]]`` template< typename Range> - ranged_parallel_group< typename std::decay< Range >::type > ``[link asio.reference.experimental__make_parallel_group.overload2 make_parallel_group]``( + ranged_parallel_group< decay_t< Range > > ``[link asio.reference.experimental__make_parallel_group.overload2 make_parallel_group]``( Range && range, - typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + constraint_t< is_async_operation_range< decay_t< Range > >::value > = 0); `` [''''»''' [link asio.reference.experimental__make_parallel_group.overload2 more...]]`` template< typename Allocator, typename Range> - ranged_parallel_group< typename std::decay< Range >::type, Allocator > ``[link asio.reference.experimental__make_parallel_group.overload3 make_parallel_group]``( + ranged_parallel_group< decay_t< Range >, Allocator > ``[link asio.reference.experimental__make_parallel_group.overload3 make_parallel_group]``( allocator_arg_t , const Allocator & allocator, Range && range, - typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + constraint_t< is_async_operation_range< decay_t< Range > >::value > = 0); `` [''''»''' [link asio.reference.experimental__make_parallel_group.overload3 more...]]`` [heading Requirements] @@ -102394,44 +101713,44 @@ Create a group of operations that may be launched in parallel. template< typename... Ops> - parallel_group< Ops...> make_parallel_group( + parallel_group< Ops... > make_parallel_group( Ops... ops); For example: - asio::experimental::make_parallel_group( - [&](auto token) - { - return in.async_read_some(asio::buffer(data), token); - }, - [&](auto token) - { - return timer.async_wait(token); - } - ).async_wait( - asio::experimental::wait_for_all(), - []( - std::array completion_order, - std::error_code ec1, std::size_t n1, - std::error_code ec2 - ) + asio::experimental::make_parallel_group( + [&](auto token) + { + return in.async_read_some(asio::buffer(data), token); + }, + [&](auto token) + { + return timer.async_wait(token); + } + ).async_wait( + asio::experimental::wait_for_all(), + []( + std::array completion_order, + std::error_code ec1, std::size_t n1, + std::error_code ec2 + ) + { + switch (completion_order[0]) { - switch (completion_order[0]) + case 0: { - case 0: - { - std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n"; - } - break; - case 1: - { - std::cout << "timer finished: " << ec2 << "\n"; - } - break; + std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n"; + } + break; + case 1: + { + std::cout << "timer finished: " << ec2 << "\n"; } + break; } - ); + } + ); @@ -102449,9 +101768,9 @@ Create a group of operations that may be launched in parallel. template< typename Range> - ranged_parallel_group< typename std::decay< Range >::type > make_parallel_group( + ranged_parallel_group< decay_t< Range > > make_parallel_group( Range && range, - typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + constraint_t< is_async_operation_range< decay_t< Range > >::value > = 0); @@ -102466,45 +101785,45 @@ Create a group of operations that may be launched in parallel. For example: - using op_type = decltype( - socket1.async_read_some( - asio::buffer(data1), - asio::deferred - ) - ); + using op_type = decltype( + socket1.async_read_some( + asio::buffer(data1), + asio::deferred + ) + ); - std::vector ops; + std::vector ops; - ops.push_back( - socket1.async_read_some( - asio::buffer(data1), - asio::deferred - ) - ); + ops.push_back( + socket1.async_read_some( + asio::buffer(data1), + asio::deferred + ) + ); - ops.push_back( - socket2.async_read_some( - asio::buffer(data2), - asio::deferred - ) - ); + ops.push_back( + socket2.async_read_some( + asio::buffer(data2), + asio::deferred + ) + ); - asio::experimental::make_parallel_group(ops).async_wait( - asio::experimental::wait_for_all(), - []( - std::vector completion_order, - std::vector e, - std::vector n - ) - { - for (std::size_t i = 0; i < completion_order.size(); ++i) - { - std::size_t idx = completion_order[i]; - std::cout << "socket " << idx << " finished: "; - std::cout << e[idx] << ", " << n[idx] << "\n"; - } - } - ); + asio::experimental::make_parallel_group(ops).async_wait( + asio::experimental::wait_for_all(), + []( + std::vector completion_order, + std::vector e, + std::vector n + ) + { + for (std::size_t i = 0; i < completion_order.size(); ++i) + { + std::size_t idx = completion_order[i]; + std::cout << "socket " << idx << " finished: "; + std::cout << e[idx] << ", " << n[idx] << "\n"; + } + } + ); @@ -102523,11 +101842,11 @@ Create a group of operations that may be launched in parallel. template< typename Allocator, typename Range> - ranged_parallel_group< typename std::decay< Range >::type, Allocator > make_parallel_group( + ranged_parallel_group< decay_t< Range >, Allocator > make_parallel_group( allocator_arg_t , const Allocator & allocator, Range && range, - typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + constraint_t< is_async_operation_range< decay_t< Range > >::value > = 0); @@ -102544,49 +101863,49 @@ Create a group of operations that may be launched in parallel. For example: - using op_type = decltype( - socket1.async_read_some( - asio::buffer(data1), - asio::deferred - ) - ); + using op_type = decltype( + socket1.async_read_some( + asio::buffer(data1), + asio::deferred + ) + ); - std::vector ops; + std::vector ops; - ops.push_back( - socket1.async_read_some( - asio::buffer(data1), - asio::deferred - ) - ); + ops.push_back( + socket1.async_read_some( + asio::buffer(data1), + asio::deferred + ) + ); - ops.push_back( - socket2.async_read_some( - asio::buffer(data2), - asio::deferred - ) - ); + ops.push_back( + socket2.async_read_some( + asio::buffer(data2), + asio::deferred + ) + ); - asio::experimental::make_parallel_group( - std::allocator_arg_t, - my_allocator, - ops - ).async_wait( - asio::experimental::wait_for_all(), - []( - std::vector completion_order, - std::vector e, - std::vector n - ) - { - for (std::size_t i = 0; i < completion_order.size(); ++i) - { - std::size_t idx = completion_order[i]; - std::cout << "socket " << idx << " finished: "; - std::cout << e[idx] << ", " << n[idx] << "\n"; - } - } - ); + asio::experimental::make_parallel_group( + std::allocator_arg_t, + my_allocator, + ops + ).async_wait( + asio::experimental::wait_for_all(), + []( + std::vector completion_order, + std::vector e, + std::vector n + ) + { + for (std::size_t i = 0; i < completion_order.size(); ++i) + { + std::size_t idx = completion_order[i]; + std::cout << "socket " << idx << " finished: "; + std::cout << e[idx] << ", " << n[idx] << "\n"; + } + } + ); @@ -102657,7 +101976,7 @@ Initiate an asynchronous wait for the group of operations. template< typename CancellationCondition, typename CompletionToken> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + auto async_wait( CancellationCondition cancellation_condition, CompletionToken && token); @@ -102715,24 +102034,9 @@ Constructor. The completion signature for the group of operations. - typedef detail::parallel_group_signature< sizeof...(Ops), typename completion_signature_of< Ops >::type...>::type signature; + typedef detail::parallel_group_signature< sizeof...(Ops), completion_signature_of_t< Ops >... >::type signature; -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.completion_signature_of.type [*type]]] - [] - - ] - -] - -Class template `completion_signature_of` is a trait with a member type alias `type` that denotes the completion signature of the asynchronous operation initiated by the expression `T(Args..., token)` operation, where `token` is an unspecified completion token type. If the asynchronous operation does not have exactly one completion signature, the instantion of the trait is well-formed but the member type alias `type` is omitted. If the expression `T(Args..., token)` is not an asynchronous operation then use of the trait is ill-formed. - [heading Requirements] @@ -102762,6 +102066,19 @@ A disposable handle for an eager operation. struct promise +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__promise.value_type [*value_type]]] + [The value that's returned by the promise. ] + + ] + +] + [heading Member Functions] [table [[Name][Description]] @@ -102793,11 +102110,17 @@ A disposable handle for an eager operation. ] -Signature The signature of the operation. -Executor The executor to be used by the promise (taken from the operation). -Allocator The allocator used for the promise. Can be set through use\_allocator. +[variablelist + +[[Signature][The signature of the operation.]] + +[[Executor][The executor to be used by the promise (taken from the operation).]] + +[[Allocator][The allocator used for the promise. Can be set through use\_allocator.]] + +] A promise can be used to initiate an asynchronous option that can be completed later. If the promise gets destroyed before completion, the operation gets a cancel signal and the result is ignored. @@ -102808,13 +102131,13 @@ A promise fulfills the requirements of async\_operation. Reading and writing from one coroutine. - awaitable read_write_some(asio::ip::tcp::socket & sock, - asio::mutable_buffer read_buf, asio::const_buffer to_write) - { - auto p = asio::async_read(read_buf, asio::use_awaitable); - co_await asio::async_write_some(to_write, asio::deferred); - co_await p; - } + awaitable read_write_some(asio::ip::tcp::socket & sock, + asio::mutable_buffer read_buf, asio::const_buffer to_write) + { + auto p = asio::async_read(read_buf, asio::use_awaitable); + co_await asio::async_write_some(to_write, asio::deferred); + co_await p; + } @@ -102929,6 +102252,40 @@ Wait for the promise to become ready. [endsect] +[section:value_type experimental::promise::value_type] + +[indexterm2 asio.indexterm.experimental__promise.value_type..value_type..experimental::promise] +The value that's returned by the promise. + + + typedef typename promise_value_type< Ts... >::type value_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__promise_value_type.type [*type]]] + [] + + ] + +] + + +[heading Requirements] + +['Header: ][^asio/experimental/promise.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:_promise experimental::promise::~promise] [indexterm2 asio.indexterm.experimental__promise._promise..~promise..experimental::promise] @@ -102954,10 +102311,23 @@ It is safe to destruct a promise of a promise that didn't complete. template< - typename... Ts> + typename ... Ts> struct promise_value_type +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__promise_value_type.type [*type]]] + [] + + ] + +] + [heading Requirements] ['Header: ][^asio/experimental/promise.hpp] @@ -102965,6 +102335,25 @@ It is safe to destruct a promise of a promise that didn't complete. ['Convenience header: ]None +[section:type experimental::promise_value_type::type] + +[indexterm2 asio.indexterm.experimental__promise_value_type.type..type..experimental::promise_value_type] + + typedef std::tuple< Ts... > type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/promise.hpp] + +['Convenience header: ]None + + +[endsect] + + + [endsect] [section:experimental__promise_value_type_lt__T__gt_ experimental::promise_value_type< T >] @@ -102978,6 +102367,34 @@ It is safe to destruct a promise of a promise that didn't complete. struct promise_value_type< T > +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__promise_value_type_lt__T__gt_.type [*type]]] + [] + + ] + +] + +[heading Requirements] + +['Header: ][^asio/experimental/promise.hpp] + +['Convenience header: ]None + + +[section:type experimental::promise_value_type< T >::type] + +[indexterm2 asio.indexterm.experimental__promise_value_type_lt__T__gt_.type..type..experimental::promise_value_type< T >] + + typedef T type; + + + [heading Requirements] ['Header: ][^asio/experimental/promise.hpp] @@ -102985,6 +102402,10 @@ It is safe to destruct a promise of a promise that didn't complete. ['Convenience header: ]None +[endsect] + + + [endsect] [section:experimental__promise_value_type_lt__gt_ experimental::promise_value_type<>] @@ -102997,6 +102418,19 @@ It is safe to destruct a promise of a promise that didn't complete. struct promise_value_type<> +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__promise_value_type_lt__gt_.type [*type]]] + [] + + ] + +] + [heading Requirements] ['Header: ][^asio/experimental/promise.hpp] @@ -103004,6 +102438,25 @@ It is safe to destruct a promise of a promise that didn't complete. ['Convenience header: ]None +[section:type experimental::promise_value_type<>::type] + +[indexterm2 asio.indexterm.experimental__promise_value_type_lt__gt_.type..type..experimental::promise_value_type<>] + + typedef std::tuple<> type; + + + +[heading Requirements] + +['Header: ][^asio/experimental/promise.hpp] + +['Convenience header: ]None + + +[endsect] + + + [endsect] [section:experimental__ranged_parallel_group experimental::ranged_parallel_group] @@ -103027,7 +102480,7 @@ A range-based group of asynchronous operations that may be launched in parallel. [ [[link asio.reference.experimental__ranged_parallel_group.signature [*signature]]] - [The completion signature for the group of operations. ] + [] ] @@ -103067,7 +102520,7 @@ Initiate an asynchronous wait for the group of operations. template< typename CancellationCondition, typename CompletionToken> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + auto async_wait( CancellationCondition cancellation_condition, CompletionToken && token); @@ -103123,10 +102576,8 @@ Constructor. [section:signature experimental::ranged_parallel_group::signature] [indexterm2 asio.indexterm.experimental__ranged_parallel_group.signature..signature..experimental::ranged_parallel_group] -The completion signature for the group of operations. - - typedef detail::ranged_parallel_group_signature< typename completion_signature_of< typename std::decay< decltype(*std::declval< typename Range::iterator >))>::type >::type, Allocator >::type signature; + typedef Allocator ::type signature; @@ -103144,6 +102595,184 @@ The completion signature for the group of operations. [endsect] +[section:experimental__task experimental::task] + +[indexterm1 asio.indexterm.experimental__task..experimental::task] + +A task is a coro that does not yield values. + + + typedef coro< void(), T, Executor, Allocator > task; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__coro.allocator_type [*allocator_type]]] + [The allocator type. ] + + ] + + [ + + [[link asio.reference.experimental__coro.completion_handler [*completion_handler]]] + [Completion handler type used by async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro.error_type [*error_type]]] + [The error type of the coroutine. Void for noexcept. ] + + ] + + [ + + [[link asio.reference.experimental__coro.executor_type [*executor_type]]] + [The executor type. ] + + ] + + [ + + [[link asio.reference.experimental__coro.input_type [*input_type]]] + [The value that can be passed into a symmetrical cororoutine. void if asymmetrical. ] + + ] + + [ + + [[link asio.reference.experimental__coro.promise_type [*promise_type]]] + [The internal promise-type of the coroutine. ] + + ] + + [ + + [[link asio.reference.experimental__coro.result_type [*result_type]]] + [The type received by a co_await or async_resume. Its a combination of yield and return. ] + + ] + + [ + + [[link asio.reference.experimental__coro.return_type [*return_type]]] + [The type that can be passed out through a co_return. ] + + ] + + [ + + [[link asio.reference.experimental__coro.signature_type [*signature_type]]] + [The signature used by the async_resume. ] + + ] + + [ + + [[link asio.reference.experimental__coro.traits [*traits]]] + [The traits of the coroutine. See asio::experimental::coro_traits for details. ] + + ] + + [ + + [[link asio.reference.experimental__coro.yield_type [*yield_type]]] + [The type that can be passed out through a co_yield. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__coro.async_resume [*async_resume]]] + [Resume the coroutine. ] + ] + + [ + [[link asio.reference.experimental__coro.coro [*coro]] [constructor]] + [The default constructor, gives an invalid coroutine. + [hr] + Move constructor. + [hr] + ] + ] + + [ + [[link asio.reference.experimental__coro.get_allocator [*get_allocator]]] + [Get the used allocator. ] + ] + + [ + [[link asio.reference.experimental__coro.get_executor [*get_executor]]] + [Get the used executor. ] + ] + + [ + [[link asio.reference.experimental__coro.is_open [*is_open]]] + [Check whether the coroutine is open, i.e. can be resumed. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_bool [*operator bool]]] + [Check whether the coroutine is open, i.e. can be resumed. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_co_await [*operator co_await]]] + [Operator used for coroutines without input value. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_lp__rp_ [*operator()]]] + [Operator used for coroutines with input value. ] + ] + + [ + [[link asio.reference.experimental__coro.operator_eq_ [*operator=]]] + [Move assignment. ] + ] + + [ + [[link asio.reference.experimental__coro._coro [*~coro]] [destructor]] + [Destructor. Destroys the coroutine, if it holds a valid one. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__coro.is_noexcept [*is_noexcept]] [static]] + [Whether or not the coroutine is noexcept. ] + ] + +] + +Template parameter `Yield` specifies type or signature used by co\_yield, `Return` specifies the type used for co\_return, and `Executor` specifies the underlying executor type. + + +[heading Requirements] + +['Header: ][^asio/experimental/coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:experimental__use_coro experimental::use_coro] [indexterm1 asio.indexterm.experimental__use_coro..experimental::use_coro] @@ -103190,6 +102819,13 @@ A [link asio.overview.model.completion_tokens completion token] that creates ano ] + [ + + [[link asio.reference.experimental__use_coro_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use use_coro_t as its default completion token type. ] + + ] + [ [[link asio.reference.experimental__use_coro_t__executor_with_default [*executor_with_default]]] @@ -103232,10 +102868,10 @@ The `use_coro_t` class, with its value `use_coro`, is used to represent an opera coro my_coroutine(tcp::socket my_socket) - { - std::size_t n = co_await my_socket.async_read_some(buffer, use_coro); - ... - } + { + std::size_t n = co_await my_socket.async_read_some(buffer, use_coro); + ... + } @@ -103280,7 +102916,7 @@ Function helper to adapt an I/O object to use `use_coro_t` as its default comple template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -103289,6 +102925,51 @@ Function helper to adapt an I/O object to use `use_coro_t` as its default comple +[section:as_default_on_t experimental::use_coro_t::as_default_on_t] + +[indexterm2 asio.indexterm.experimental__use_coro_t.as_default_on_t..as_default_on_t..experimental::use_coro_t] +Type alias to adapt an I/O object to use `use_coro_t` as its default completion token type. + + + typedef typename T::template rebind_executor< executor_with_default< typename T::executor_type > >::other as_default_on_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.experimental__use_coro_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify use_coro_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__use_coro_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/experimental/use_coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:get_allocator experimental::use_coro_t::get_allocator] [indexterm2 asio.indexterm.experimental__use_coro_t.get_allocator..get_allocator..experimental::use_coro_t] @@ -103325,7 +103006,8 @@ Specify an alternate allocator. Default constructor. - constexpr ``[link asio.reference.experimental__use_coro_t.use_coro_t.overload1 use_coro_t]``(); + constexpr ``[link asio.reference.experimental__use_coro_t.use_coro_t.overload1 use_coro_t]``( + allocator_type allocator = allocator_type{}); `` [''''»''' [link asio.reference.experimental__use_coro_t.use_coro_t.overload1 more...]]`` @@ -103335,7 +103017,8 @@ Constructor used to specify file name, line, and function name. constexpr ``[link asio.reference.experimental__use_coro_t.use_coro_t.overload2 use_coro_t]``( const char * file_name, int line, - const char * function_name); + const char * function_name, + allocator_type allocator = allocator_type{}); `` [''''»''' [link asio.reference.experimental__use_coro_t.use_coro_t.overload2 more...]]`` @@ -103345,7 +103028,8 @@ Constructor used to specify file name, line, and function name. Default constructor. - constexpr use_coro_t(); + constexpr use_coro_t( + allocator_type allocator = allocator_type{}); @@ -103362,7 +103046,8 @@ Constructor used to specify file name, line, and function name. constexpr use_coro_t( const char * file_name, int line, - const char * function_name); + const char * function_name, + allocator_type allocator = allocator_type{}); @@ -103384,7 +103069,8 @@ Adapts an executor to add the `use_coro_t` completion token as the default. template< typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + struct executor_with_default : + public InnerExecutor [heading Types] @@ -103438,6 +103124,13 @@ Specify `use_coro_t` as the default completion token type. ] + [ + + [[link asio.reference.experimental__use_coro_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use use_coro_t as its default completion token type. ] + + ] + [ [[link asio.reference.experimental__use_coro_t__executor_with_default [*executor_with_default]]] @@ -103480,10 +103173,10 @@ The `use_coro_t` class, with its value `use_coro`, is used to represent an opera coro my_coroutine(tcp::socket my_socket) - { - std::size_t n = co_await my_socket.async_read_some(buffer, use_coro); - ... - } + { + std::size_t n = co_await my_socket.async_read_some(buffer, use_coro); + ... + } @@ -103514,7 +103207,7 @@ Construct the adapted executor from the inner executor type. typename ``[link asio.reference.Executor1 InnerExecutor1]``> executor_with_default( const InnerExecutor1 & ex, - typename constraint< conditional< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::type::value >::type = 0); + constraint_t< conditional_t< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::value > = 0); @@ -103638,7 +103331,7 @@ Function helper to adapt an I/O object to use `use_promise_t` as its default com template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -103738,7 +103431,8 @@ Adapts an executor to add the `use_promise_t` completion token as the default. template< typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + struct executor_with_default : + public InnerExecutor [heading Types] @@ -103860,7 +103554,7 @@ Convert the specified executor to the inner executor type, then use that to cons typename ``[link asio.reference.Executor1 OtherExecutor]``> ``[link asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload2 executor_with_default]``( const OtherExecutor & ex, - typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, InnerExecutor >::value > = 0); `` [''''»''' [link asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload2 more...]]`` @@ -103889,7 +103583,7 @@ Convert the specified executor to the inner executor type, then use that to cons typename ``[link asio.reference.Executor1 OtherExecutor]``> executor_with_default( const OtherExecutor & ex, - typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + constraint_t< is_convertible< OtherExecutor, InnerExecutor >::value > = 0); @@ -104056,7 +103750,7 @@ If no operation completes with an error, waits for completion of all operations. template< typename E, typename... Args> - constexpr constraint< !is_same< typename decay< E >::type, asio::error_code >::value &&!is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type ``[link asio.reference.experimental__wait_for_one_error.operator_lp__rp_.overload2 operator()]``( + constexpr constraint_t< !is_same< decay_t< E >, asio::error_code >::value &&!is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > ``[link asio.reference.experimental__wait_for_one_error.operator_lp__rp_.overload2 operator()]``( const E & , Args && ...) const; `` [''''»''' [link asio.reference.experimental__wait_for_one_error.operator_lp__rp_.overload2 more...]]`` @@ -104064,7 +103758,7 @@ If no operation completes with an error, waits for completion of all operations. template< typename E, typename... Args> - constexpr constraint< is_same< typename decay< E >::type, asio::error_code >::value||is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type ``[link asio.reference.experimental__wait_for_one_error.operator_lp__rp_.overload3 operator()]``( + constexpr constraint_t< is_same< decay_t< E >, asio::error_code >::value||is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > ``[link asio.reference.experimental__wait_for_one_error.operator_lp__rp_.overload3 operator()]``( const E & e, Args && ...) const; `` [''''»''' [link asio.reference.experimental__wait_for_one_error.operator_lp__rp_.overload3 more...]]`` @@ -104089,7 +103783,7 @@ If no operation completes with an error, waits for completion of all operations. template< typename E, typename... Args> - constexpr constraint< !is_same< typename decay< E >::type, asio::error_code >::value &&!is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type operator()( + constexpr constraint_t< !is_same< decay_t< E >, asio::error_code >::value &&!is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > operator()( const E & , Args && ...) const; @@ -104106,7 +103800,7 @@ If no operation completes with an error, waits for completion of all operations. template< typename E, typename... Args> - constexpr constraint< is_same< typename decay< E >::type, asio::error_code >::value||is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type operator()( + constexpr constraint_t< is_same< decay_t< E >, asio::error_code >::value||is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > operator()( const E & e, Args && ...) const; @@ -104178,7 +103872,7 @@ If no operation completes without an error, waits for completion of all operatio template< typename E, typename... Args> - constexpr constraint< !is_same< typename decay< E >::type, asio::error_code >::value &&!is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type ``[link asio.reference.experimental__wait_for_one_success.operator_lp__rp_.overload2 operator()]``( + constexpr constraint_t< !is_same< decay_t< E >, asio::error_code >::value &&!is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > ``[link asio.reference.experimental__wait_for_one_success.operator_lp__rp_.overload2 operator()]``( const E & , Args && ...) const; `` [''''»''' [link asio.reference.experimental__wait_for_one_success.operator_lp__rp_.overload2 more...]]`` @@ -104186,7 +103880,7 @@ If no operation completes without an error, waits for completion of all operatio template< typename E, typename... Args> - constexpr constraint< is_same< typename decay< E >::type, asio::error_code >::value||is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type ``[link asio.reference.experimental__wait_for_one_success.operator_lp__rp_.overload3 operator()]``( + constexpr constraint_t< is_same< decay_t< E >, asio::error_code >::value||is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > ``[link asio.reference.experimental__wait_for_one_success.operator_lp__rp_.overload3 operator()]``( const E & e, Args && ...) const; `` [''''»''' [link asio.reference.experimental__wait_for_one_success.operator_lp__rp_.overload3 more...]]`` @@ -104211,7 +103905,7 @@ If no operation completes without an error, waits for completion of all operatio template< typename E, typename... Args> - constexpr constraint< !is_same< typename decay< E >::type, asio::error_code >::value &&!is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type operator()( + constexpr constraint_t< !is_same< decay_t< E >, asio::error_code >::value &&!is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > operator()( const E & , Args && ...) const; @@ -104228,7 +103922,7 @@ If no operation completes without an error, waits for completion of all operatio template< typename E, typename... Args> - constexpr constraint< is_same< typename decay< E >::type, asio::error_code >::value||is_same< typename decay< E >::type, std::exception_ptr >::value, cancellation_type_t >::type operator()( + constexpr constraint_t< is_same< decay_t< E >, asio::error_code >::value||is_same< decay_t< E >, std::exception_ptr >::value, cancellation_type_t > operator()( const E & e, Args && ...) const; @@ -104581,7 +104275,9 @@ Describes an endpoint for any socket type. [hr] Construct an endpoint from the specific endpoint type. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -104596,7 +104292,9 @@ Describes an endpoint for any socket type. [ [[link asio.reference.generic__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -104713,7 +104411,15 @@ Copy constructor. `` [''''»''' [link asio.reference.generic__basic_endpoint.basic_endpoint.overload4 more...]]`` -[section:overload1 generic::basic_endpoint::basic_endpoint (1 of 4 overloads)] +Move constructor. + + + ``[link asio.reference.generic__basic_endpoint.basic_endpoint.overload5 basic_endpoint]``( + basic_endpoint && other); + `` [''''»''' [link asio.reference.generic__basic_endpoint.basic_endpoint.overload5 more...]]`` + + +[section:overload1 generic::basic_endpoint::basic_endpoint (1 of 5 overloads)] Default constructor. @@ -104727,7 +104433,7 @@ Default constructor. -[section:overload2 generic::basic_endpoint::basic_endpoint (2 of 4 overloads)] +[section:overload2 generic::basic_endpoint::basic_endpoint (2 of 5 overloads)] Construct an endpoint from the specified socket address. @@ -104744,7 +104450,7 @@ Construct an endpoint from the specified socket address. -[section:overload3 generic::basic_endpoint::basic_endpoint (3 of 4 overloads)] +[section:overload3 generic::basic_endpoint::basic_endpoint (3 of 5 overloads)] Construct an endpoint from the specific endpoint type. @@ -104761,7 +104467,7 @@ Construct an endpoint from the specific endpoint type. -[section:overload4 generic::basic_endpoint::basic_endpoint (4 of 4 overloads)] +[section:overload4 generic::basic_endpoint::basic_endpoint (4 of 5 overloads)] Copy constructor. @@ -104772,6 +104478,21 @@ Copy constructor. +[endsect] + + + +[section:overload5 generic::basic_endpoint::basic_endpoint (5 of 5 overloads)] + + +Move constructor. + + + basic_endpoint( + basic_endpoint && other); + + + [endsect] @@ -104861,7 +104582,7 @@ The type of the endpoint structure. This type is dependent on the underlying imp Compare two endpoints for inequality. - friend bool operator!=( + bool operator!=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -104883,7 +104604,7 @@ Compare two endpoints for inequality. Compare endpoints for ordering. - friend bool operator<( + bool operator<( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -104905,7 +104626,7 @@ Compare endpoints for ordering. Compare endpoints for ordering. - friend bool operator<=( + bool operator<=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -104920,10 +104641,28 @@ Compare endpoints for ordering. [endsect] - [section:operator_eq_ generic::basic_endpoint::operator=] [indexterm2 asio.indexterm.generic__basic_endpoint.operator_eq_..operator=..generic::basic_endpoint] +Assign from another endpoint. + + + basic_endpoint & ``[link asio.reference.generic__basic_endpoint.operator_eq_.overload1 operator=]``( + const basic_endpoint & other); + `` [''''»''' [link asio.reference.generic__basic_endpoint.operator_eq_.overload1 more...]]`` + + +Move-assign from another endpoint. + + + basic_endpoint & ``[link asio.reference.generic__basic_endpoint.operator_eq_.overload2 operator=]``( + basic_endpoint && other); + `` [''''»''' [link asio.reference.generic__basic_endpoint.operator_eq_.overload2 more...]]`` + + +[section:overload1 generic::basic_endpoint::operator= (1 of 2 overloads)] + + Assign from another endpoint. @@ -104936,13 +104675,30 @@ Assign from another endpoint. +[section:overload2 generic::basic_endpoint::operator= (2 of 2 overloads)] + + +Move-assign from another endpoint. + + + basic_endpoint & operator=( + basic_endpoint && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ generic::basic_endpoint::operator==] [indexterm2 asio.indexterm.generic__basic_endpoint.operator_eq__eq_..operator==..generic::basic_endpoint] Compare two endpoints for equality. - friend bool operator==( + bool operator==( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -104964,7 +104720,7 @@ Compare two endpoints for equality. Compare endpoints for ordering. - friend bool operator>( + bool operator>( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -104986,7 +104742,7 @@ Compare endpoints for ordering. Compare endpoints for ordering. - friend bool operator>=( + bool operator>=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -105150,12 +104906,12 @@ The [link asio.reference.generic__datagram_protocol `generic::datagram_protocol` Constructing using a native address family and socket protocol: - datagram_protocol p(AF_INET, IPPROTO_UDP); + datagram_protocol p(AF_INET, IPPROTO_UDP); Constructing from a specific protocol type: - datagram_protocol p(asio::ip::udp::v4()); + datagram_protocol p(asio::ip::udp::v4()); @@ -105232,11 +104988,11 @@ Construct a generic protocol object from a specific protocol. [variablelist -[[@c][bad\_cast Thrown if the source protocol is not datagram-oriented. ]] +[[][]] ] - +c bad\_cast Thrown if the source protocol is not datagram-oriented. [endsect] @@ -105286,7 +105042,9 @@ The type of an endpoint. [hr] Construct an endpoint from the specific endpoint type. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -105301,7 +105059,9 @@ The type of an endpoint. [ [[link asio.reference.generic__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -105406,7 +105166,7 @@ Obtain an identifier for the protocol family. Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const datagram_protocol & p1, const datagram_protocol & p2); @@ -105428,7 +105188,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const datagram_protocol & p1, const datagram_protocol & p2); @@ -105983,12 +105743,12 @@ The [link asio.reference.generic__raw_protocol `generic::raw_protocol`] class co Constructing using a native address family and socket protocol: - raw_protocol p(AF_INET, IPPROTO_ICMP); + raw_protocol p(AF_INET, IPPROTO_ICMP); Constructing from a specific protocol type: - raw_protocol p(asio::ip::icmp::v4()); + raw_protocol p(asio::ip::icmp::v4()); @@ -106051,7 +105811,9 @@ The type of an endpoint. [hr] Construct an endpoint from the specific endpoint type. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -106066,7 +105828,9 @@ The type of an endpoint. [ [[link asio.reference.generic__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -106171,7 +105935,7 @@ Obtain an identifier for the protocol family. Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const raw_protocol & p1, const raw_protocol & p2); @@ -106193,7 +105957,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const raw_protocol & p1, const raw_protocol & p2); @@ -106278,11 +106042,11 @@ Construct a generic protocol object from a specific protocol. [variablelist -[[@c][bad\_cast Thrown if the source protocol is not raw-oriented. ]] +[[][]] ] - +c bad\_cast Thrown if the source protocol is not raw-oriented. [endsect] @@ -106816,7 +106580,7 @@ The [link asio.reference.generic__seq_packet_protocol `generic::seq_packet_proto Constructing using a native address family and socket protocol: - seq_packet_protocol p(AF_INET, IPPROTO_SCTP); + seq_packet_protocol p(AF_INET, IPPROTO_SCTP); @@ -106879,7 +106643,9 @@ The type of an endpoint. [hr] Construct an endpoint from the specific endpoint type. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -106894,7 +106660,9 @@ The type of an endpoint. [ [[link asio.reference.generic__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -106999,7 +106767,7 @@ Obtain an identifier for the protocol family. Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const seq_packet_protocol & p1, const seq_packet_protocol & p2); @@ -107021,7 +106789,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const seq_packet_protocol & p1, const seq_packet_protocol & p2); @@ -107106,11 +106874,11 @@ Construct a generic protocol object from a specific protocol. [variablelist -[[@c][bad\_cast Thrown if the source protocol is not based around sequenced packets. ]] +[[][]] ] - +c bad\_cast Thrown if the source protocol is not based around sequenced packets. [endsect] @@ -107633,12 +107401,12 @@ The [link asio.reference.generic__stream_protocol `generic::stream_protocol`] cl Constructing using a native address family and socket protocol: - stream_protocol p(AF_INET, IPPROTO_TCP); + stream_protocol p(AF_INET, IPPROTO_TCP); Constructing from a specific protocol type: - stream_protocol p(asio::ip::tcp::v4()); + stream_protocol p(asio::ip::tcp::v4()); @@ -107701,7 +107469,9 @@ The type of an endpoint. [hr] Construct an endpoint from the specific endpoint type. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -107716,7 +107486,9 @@ The type of an endpoint. [ [[link asio.reference.generic__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -107968,7 +107740,7 @@ The generic socket iostream type. Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const stream_protocol & p1, const stream_protocol & p2); @@ -107990,7 +107762,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const stream_protocol & p1, const stream_protocol & p2); @@ -108507,11 +108279,11 @@ Construct a generic protocol object from a specific protocol. [variablelist -[[@c][bad\_cast Thrown if the source protocol is not stream-oriented. ]] +[[][]] ] - +c bad\_cast Thrown if the source protocol is not stream-oriented. [endsect] @@ -108682,7 +108454,7 @@ Helper function to obtain an object's associated [link asio.reference.cancellati [heading Return Value] -`associated_cancellation_slotget(t, st)` +`associated_cancellation_slot::get(t, st)` @@ -108710,16 +108482,16 @@ Helper function to obtain an object's associated executor. auto ``[link asio.reference.get_associated_executor.overload2 get_associated_executor]``( const T & t, const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.get_associated_executor.overload2 more...]]`` template< typename T, typename ExecutionContext> - associated_executor< T, typename ExecutionContext::executor_type >::type ``[link asio.reference.get_associated_executor.overload3 get_associated_executor]``( + associated_executor< T, typenameExecutionContext::executor_type >::type ``[link asio.reference.get_associated_executor.overload3 get_associated_executor]``( const T & t, ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.get_associated_executor.overload3 more...]]`` [heading Requirements] @@ -108765,7 +108537,7 @@ Helper function to obtain an object's associated executor. auto get_associated_executor( const T & t, const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -108789,16 +108561,16 @@ 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( + associated_executor< T, typenameExecutionContext::executor_type >::type get_associated_executor( const T & t, ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); [heading Return Value] -`associated_executorget(t, ctx.get_executor())` +`associated_executor::get(t, ctx.get_executor())` @@ -108820,16 +108592,16 @@ Helper function to obtain an object's associated executor. auto ``[link asio.reference.get_associated_immediate_executor.overload1 get_associated_immediate_executor]``( const T & t, const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.get_associated_immediate_executor.overload1 more...]]`` template< typename T, typename ExecutionContext> - associated_immediate_executor< T, typename ExecutionContext::executor_type >::type ``[link asio.reference.get_associated_immediate_executor.overload2 get_associated_immediate_executor]``( + associated_immediate_executor< T, typenameExecutionContext::executor_type >::type ``[link asio.reference.get_associated_immediate_executor.overload2 get_associated_immediate_executor]``( const T & t, ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.get_associated_immediate_executor.overload2 more...]]`` [heading Requirements] @@ -108851,7 +108623,7 @@ Helper function to obtain an object's associated executor. auto get_associated_immediate_executor( const T & t, const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -108875,16 +108647,16 @@ Helper function to obtain an object's associated executor. template< typename T, typename ExecutionContext> - associated_immediate_executor< T, typename ExecutionContext::executor_type >::type get_associated_immediate_executor( + associated_immediate_executor< T, typenameExecutionContext::executor_type >::type get_associated_immediate_executor( const T & t, ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); [heading Return Value] -`associated_immediate_executorget(t, ctx.get_executor())` +`associated_immediate_executor::get(t, ctx.get_executor())` @@ -109058,14 +108830,14 @@ This waitable timer functionality is for use with the C++11 standard library's ` Performing a blocking wait (C++11): - // Construct a timer without setting an expiry time. - asio::steady_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_after(std::chrono::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -109073,22 +108845,22 @@ Performing a blocking wait (C++11): Performing an asynchronous wait (C++11): - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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)); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -109102,26 +108874,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -109137,7 +108909,7 @@ Changing the expiry time of a timer while there are pending asynchronous waits c This typedef uses the C++11 `` standard library facility, if available. Otherwise, it may use the Boost.Chrono library. To explicitly utilise Boost.Chrono, use the [link asio.reference.basic_waitable_timer `basic_waitable_timer`] template directly: - typedef basic_waitable_timer timer; + typedef basic_waitable_timer timer; @@ -109251,7 +109023,7 @@ A call wrapper type to bind a immediate executor of type `Executor` to an object [ [[link asio.reference.immediate_executor_binder.operator_lp__rp_ [*operator()]]] - [] + [Forwarding function call operator. ] ] [ @@ -109670,28 +109442,32 @@ The type of the associated immediate executor. [section:operator_lp__rp_ immediate_executor_binder::operator()] [indexterm2 asio.indexterm.immediate_executor_binder.operator_lp__rp_..operator()..immediate_executor_binder] +Forwarding function call operator. + template< typename... Args> - auto ``[link asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 operator()]``( - Args && ...); + result_of_t< T(Args...)> ``[link asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 operator()]``( + Args &&... args); `` [''''»''' [link asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 more...]]`` template< typename... Args> - auto ``[link asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 operator()]``( - Args && ...) const; + result_of_t< T(Args...)> ``[link asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 operator()]``( + Args &&... args) const; `` [''''»''' [link asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 more...]]`` [section:overload1 immediate_executor_binder::operator() (1 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...); + result_of_t< T(Args...)> operator()( + Args &&... args); @@ -109702,11 +109478,13 @@ The type of the associated immediate executor. [section:overload2 immediate_executor_binder::operator() (2 of 2 overloads)] +Forwarding function call operator. + template< typename... Args> - auto operator()( - Args && ...) const; + result_of_t< T(Args...)> operator()( + Args &&... args) const; @@ -109829,7 +109607,8 @@ Destructor. Exception thrown when trying to add a service object to an [link asio.reference.execution_context `execution_context`] where the service has a different owner. - class invalid_service_owner + class invalid_service_owner : + public std::logic_error [heading Member Functions] @@ -110060,26 +109839,9 @@ Provides core I/O functionality. [table [[Name][Description]] - [ - [[link asio.reference.io_context.add_service [*add_service]]] - [(Deprecated: Use make_service().) Add a service object to the execution_context. ] - ] - - [ - [[link asio.reference.io_context.has_service [*has_service]]] - [Determine if an execution_context contains a specified service type. ] - ] - - [ - [[link asio.reference.io_context.make_service [*make_service]]] - [Creates a service object and adds it to the execution_context. ] - ] - [ [[link asio.reference.io_context.use_service [*use_service]]] - [ - [hr] - Obtain the service object corresponding to the given type. ] + [] ] ] @@ -110125,20 +109887,20 @@ 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. - } - } + asio::io_context io_context; + ... + for (;;) + { + try + { + io_context.run(); + break; // run() exited normally + } + catch (my_exception& e) + { + // Deal with exception as appropriate. + } + } @@ -110155,26 +109917,26 @@ For example: void my_task() - { - ... - } + { + ... + } - ... + ... - asio::io_context io_context; + asio::io_context io_context; - // Submit a function to the io_context. - asio::post(io_context, my_task); + // 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, - []() - { - ... - }); + // 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(); + // Run the io_context until it runs out of work. + io_context.run(); @@ -110189,9 +109951,9 @@ Some applications may need to prevent an [link asio.reference.io_context `io_con asio::io_context io_context; - asio::executor_work_guard - = asio::make_work_guard(io_context); - ... + asio::executor_work_guard + = asio::make_work_guard(io_context); + ... @@ -110203,10 +109965,10 @@ Alternatively, if the application requires that all operations and handlers be a asio::io_context io_context; - asio::executor_work_guard - = asio::make_work_guard(io_context); - ... - work.reset(); // Allow run() to exit. + asio::executor_work_guard + = asio::make_work_guard(io_context); + ... + work.reset(); // Allow run() to exit. @@ -110218,65 +109980,6 @@ Alternatively, if the application requires that all operations and handlers be a ['Convenience header: ][^asio.hpp] -[section:add_service io_context::add_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.io_context.add_service..add_service..io_context] -(Deprecated: Use `make_service()`.) Add a service object to the [link asio.reference.execution_context `execution_context`]. - - - template< - typename ``[link asio.reference.Service Service]``> - friend void add_service( - execution_context & e, - Service * svc); - - -This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: -`` - delete static_cast(svc) -`` -]] - -] - - -[heading Exceptions] - - -[variablelist - -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] - -[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] - -] - - - -[heading Requirements] - -['Header: ][^asio/io_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:count_type io_context::count_type] [indexterm2 asio.indexterm.io_context.count_type..count_type..io_context] @@ -110330,7 +110033,7 @@ This function is implemented as follows: template< typename ``[link asio.reference.LegacyCompletionHandler LegacyCompletionHandler]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` dispatch( + auto dispatch( LegacyCompletionHandler && handler); @@ -110344,9 +110047,9 @@ The [link asio.reference.io_context `io_context`] guarantees that the handler wi [variablelist -[[handler][The handler to be called. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: +[[handler][The handler to be called. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: `` - void handler(); + void handler(); `` ]] @@ -110358,7 +110061,7 @@ The [link asio.reference.io_context `io_context`] guarantees that the handler wi This function throws an exception only if: -* the handler's `asio_handler_allocate` function; or +* the handler's associated allocator; or * the handler's copy constructor @@ -110562,51 +110265,6 @@ Obtains the executor associated with the [link asio.reference.io_context `io_con [endsect] - -[section:has_service io_context::has_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.io_context.has_service..has_service..io_context] -Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. - - - template< - typename ``[link asio.reference.Service Service]``> - friend bool has_service( - execution_context & e); - - -This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -] - - -[heading Return Value] - -A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. - - - -[heading Requirements] - -['Header: ][^asio/io_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:io_context io_context::io_context] [indexterm2 asio.indexterm.io_context.io_context..io_context..io_context] @@ -110666,60 +110324,6 @@ Construct with a hint about the required level of concurrency. [endsect] -[section:make_service io_context::make_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.io_context.make_service..make_service..io_context] -Creates a service object and adds it to the [link asio.reference.execution_context `execution_context`]. - - - template< - typename ``[link asio.reference.Service Service]``, - typename... Args> - friend Service & make_service( - execution_context & e, - Args &&... args); - - -This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -[[args][Zero or more arguments to be passed to the service constructor.]] - -] - - -[heading Exceptions] - - -[variablelist - -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`]. ]] - -] - - - -[heading Requirements] - -['Header: ][^asio/io_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:notify_fork io_context::notify_fork] @@ -110735,7 +110339,7 @@ Notify the [link asio.reference.execution_context `execution_context`] of a fork This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `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 [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. [heading Parameters] @@ -110763,16 +110367,16 @@ This function must not be called while any other [link asio.reference.execution_ 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); - } + 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); + } @@ -110949,7 +110553,7 @@ The number of handlers that were executed. template< typename ``[link asio.reference.LegacyCompletionHandler LegacyCompletionHandler]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( + auto post( LegacyCompletionHandler && handler); @@ -110963,9 +110567,9 @@ The [link asio.reference.io_context `io_context`] guarantees that the handler wi [variablelist -[[handler][The handler to be called. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: +[[handler][The handler to be called. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: `` - void handler(); + void handler(); `` ]] @@ -110977,7 +110581,7 @@ The [link asio.reference.io_context `io_context`] guarantees that the handler wi This function throws an exception only if: -* the handler's `asio_handler_allocate` function; or +* the handler's associated allocator; or * the handler's copy constructor @@ -111218,6 +110822,9 @@ The `run_one()` function blocks until one handler has been dispatched, or until The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_context `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()`. + +[heading Return Value] + The number of handlers that were executed. @@ -111407,34 +111014,14 @@ This function is used to determine whether an [link asio.reference.io_context `i [endsect] + [section:use_service io_context::use_service] [indexterm2 asio.indexterm.io_context.use_service..use_service..io_context] template< typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.io_context.use_service.overload1 use_service]``( - io_context & ioc); - `` [''''»''' [link asio.reference.io_context.use_service.overload1 more...]]`` - - -Obtain the service object corresponding to the given type. - - - template< - typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.io_context.use_service.overload2 use_service]``( - execution_context & e); - `` [''''»''' [link asio.reference.io_context.use_service.overload2 more...]]`` - - -[section:overload1 io_context::use_service (1 of 2 overloads)] - - - - template< - typename ``[link asio.reference.Service Service]``> - friend Service & use_service( + Service & use_service( io_context & ioc); @@ -111449,53 +111036,6 @@ Obtain the service object corresponding to the given type. -[section:overload2 io_context::use_service (2 of 2 overloads)] - - -['Inherited from execution_context.] - - -Obtain the service object corresponding to the given type. - - - template< - typename ``[link asio.reference.Service 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 [link asio.reference.execution_context `execution_context`] will create a new instance of the service. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -] - - -[heading Return Value] - -The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. - - - -[heading Requirements] - -['Header: ][^asio/io_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - -[endsect] - - [section:wrap io_context::wrap] [indexterm2 asio.indexterm.io_context.wrap..wrap..io_context] @@ -111516,9 +111056,9 @@ This function is used to create a new handler function object that, when invoked [variablelist -[[handler][The handler to be wrapped. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: +[[handler][The handler to be wrapped. The [link asio.reference.io_context `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); + void handler(A1 a1, ... An an); `` ]] @@ -111529,22 +111069,22 @@ This function is used to create a new handler function object that, when invoked A function object that, when invoked, passes the wrapped handler to the [link asio.reference.io_context `io_context`] object's dispatch function. Given a function object with the signature: - R f(A1 a1, ... An an); + R f(A1 a1, ... An an); If this function object is passed to the wrap function like so: - io_context.wrap(f); + io_context.wrap(f); then the return value is a function object with the signature - void g(A1 a1, ... An an); + void g(A1 a1, ... An an); that, when invoked, executes code equivalent to: - io_context.dispatch(boost::bind(f, a1, ... an)); + io_context.dispatch(boost::bind(f, a1, ... an)); @@ -111607,7 +111147,8 @@ Executor implementation type used to submit functions to an [link asio.reference template< typename Allocator, uintptr_t Bits> - class basic_executor_type + class basic_executor_type : + Allocator [heading Member Functions] @@ -111823,9 +111364,9 @@ If the current thread belongs to the [link asio.reference.io_context `io_context [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -111862,9 +111403,9 @@ This function is used to ask the [link asio.reference.io_context `io_context`] t [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -111921,7 +111462,7 @@ Inform the [link asio.reference.io_context `io_context`] that it has some outsta void on_work_started() const; -This function is used to inform the [link asio.reference.io_context `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. +This function is used to inform the [link asio.reference.io_context `io_context`] that some work has begun. This ensures that the [link asio.reference.io_context `io_context`]'s `run()` and `run_one()` functions do not exit while the work is underway. [endsect] @@ -111934,7 +111475,7 @@ This function is used to inform the [link asio.reference.io_context `io_context` Compare two executors for inequality. - friend bool operator!=( + bool operator!=( const basic_executor_type & a, const basic_executor_type & b); @@ -112008,7 +111549,7 @@ Move assignment operator. Compare two executors for equality. - friend bool operator==( + bool operator==( const basic_executor_type & a, const basic_executor_type & b); @@ -112048,9 +111589,9 @@ This function is used to ask the [link asio.reference.io_context `io_context`] t [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -112120,8 +111661,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - asio::io_context& ctx = asio::query( - ex, asio::execution::context); + asio::io_context& ctx = asio::query( + ex, asio::execution::context); @@ -112146,9 +111687,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - if (asio::query(ex, asio::execution::blocking) - == asio::execution::blocking.always) - ... + if (asio::query(ex, asio::execution::blocking) + == asio::execution::blocking.always) + ... @@ -112173,9 +111714,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - if (asio::query(ex, asio::execution::relationship) - == asio::execution::relationship.continuation) - ... + if (asio::query(ex, asio::execution::relationship) + == asio::execution::relationship.continuation) + ... @@ -112202,8 +111743,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - auto alloc = asio::query(ex, - asio::execution::allocator); + auto alloc = asio::query(ex, + asio::execution::allocator); @@ -112228,8 +111769,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - auto alloc = asio::query(ex, - asio::execution::allocator); + auto alloc = asio::query(ex, + asio::execution::allocator); @@ -112274,9 +111815,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - if (asio::query(ex, asio::execution::mapping) - == asio::execution::mapping.thread) - ... + if (asio::query(ex, asio::execution::mapping) + == asio::execution::mapping.thread) + ... @@ -112301,9 +111842,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_io_context.get_executor(); - if (asio::query(ex, asio::execution::outstanding_work) - == asio::execution::outstanding_work.tracked) - ... + if (asio::query(ex, asio::execution::outstanding_work) + == asio::execution::outstanding_work.tracked) + ... @@ -112398,8 +111939,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::blocking.possibly); + auto ex2 = asio::require(ex1, + asio::execution::blocking.possibly); @@ -112424,8 +111965,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::blocking.never); + auto ex2 = asio::require(ex1, + asio::execution::blocking.never); @@ -112450,8 +111991,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::relationship.fork); + auto ex2 = asio::require(ex1, + asio::execution::relationship.fork); @@ -112476,8 +112017,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::relationship.continuation); + auto ex2 = asio::require(ex1, + asio::execution::relationship.continuation); @@ -112502,8 +112043,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::outstanding_work.tracked); + auto ex2 = asio::require(ex1, + asio::execution::outstanding_work.tracked); @@ -112528,8 +112069,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::outstanding_work.untracked); + auto ex2 = asio::require(ex1, + asio::execution::outstanding_work.untracked); @@ -112556,8 +112097,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::allocator(my_allocator)); + auto ex2 = asio::require(ex1, + asio::execution::allocator(my_allocator)); @@ -112582,8 +112123,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_io_context.get_executor(); - auto ex2 = asio::require(ex1, - asio::execution::allocator); + auto ex2 = asio::require(ex1, + asio::execution::allocator); @@ -112640,13 +112181,19 @@ Destructor. Base class for all [link asio.reference.io_context `io_context`] services. - class service + class service : + public execution_context::service [heading Member Functions] [table [[Name][Description]] + [ + [[link asio.reference.io_context__service.context [*context]]] + [Get the context object that owns the service. ] + ] + [ [[link asio.reference.io_context__service.get_io_context [*get_io_context]]] [Get the io_context object that owns the service. ] @@ -112677,6 +112224,23 @@ Base class for all [link asio.reference.io_context `io_context`] services. ['Convenience header: ][^asio.hpp] +[section:context io_context::service::context] + + +['Inherited from execution_context.] + +[indexterm2 asio.indexterm.io_context__service.context..context..io_context::service] +Get the context object that owns the service. + + + execution_context & context(); + + + +[endsect] + + + [section:get_io_context io_context::service::get_io_context] [indexterm2 asio.indexterm.io_context__service.get_io_context..get_io_context..io_context::service] @@ -112857,12 +112421,12 @@ if any of the following conditions are true: * `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)`. +then `a()` happens-before `b()` Note that in the following case: async_op_1(..., s.wrap(a)); - async_op_2(..., s.wrap(b)); + 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. @@ -112925,9 +112489,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -112961,7 +112525,7 @@ Request the strand to invoke the given function object. template< typename ``[link asio.reference.LegacyCompletionHandler LegacyCompletionHandler]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.io_context__strand.dispatch.overload2 dispatch]``( + auto ``[link asio.reference.io_context__strand.dispatch.overload2 dispatch]``( LegacyCompletionHandler && handler); `` [''''»''' [link asio.reference.io_context__strand.dispatch.overload2 more...]]`` @@ -112980,7 +112544,7 @@ Request the strand to invoke the given function object. const Allocator & a) const; -This function is used to ask the strand to execute the given function object on its underlying [link asio.reference.io_context `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. +This function is used to ask the strand to execute the given function object on its underlying [link asio.reference.io_context `io_context`]. The function object will be executed inside this function if the strand is not otherwise busy and if the underlying [link asio.reference.io_context `io_context`]'s executor's `dispatch()` function is also able to execute the function before returning. [heading Parameters] @@ -112988,9 +112552,9 @@ This function is used to ask the strand to execute the given function object on [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -113013,7 +112577,7 @@ This function is used to ask the strand to execute the given function object on template< typename ``[link asio.reference.LegacyCompletionHandler LegacyCompletionHandler]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` dispatch( + auto dispatch( LegacyCompletionHandler && handler); @@ -113021,7 +112585,7 @@ 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 [link asio.reference.io_context `io_context`]. The [link asio.reference.io_context `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. +The strand's guarantee is in addition to the guarantee provided by the underlying [link asio.reference.io_context `io_context`]. The [link asio.reference.io_context `io_context`] guarantees that the handler will only be called in a thread in which the [link asio.reference.io_context `io_context`]'s run member function is currently being invoked. [heading Parameters] @@ -113031,7 +112595,7 @@ The strand's guarantee is in addition to the guarantee provided by the underlyin [[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(); + void handler(); `` ]] @@ -113084,7 +112648,7 @@ The strand delegates this call to its underlying [link asio.reference.io_context Compare two strands for inequality. - friend bool operator!=( + bool operator!=( const strand & a, const strand & b); @@ -113108,7 +112672,7 @@ Two strands are equal if they refer to the same ordered, non-concurrent state. Compare two strands for equality. - friend bool operator==( + bool operator==( const strand & a, const strand & b); @@ -113145,7 +112709,7 @@ Request the strand to invoke the given function object. template< typename ``[link asio.reference.LegacyCompletionHandler LegacyCompletionHandler]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.io_context__strand.post.overload2 post]``( + auto ``[link asio.reference.io_context__strand.post.overload2 post]``( LegacyCompletionHandler && handler); `` [''''»''' [link asio.reference.io_context__strand.post.overload2 more...]]`` @@ -113172,9 +112736,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -113197,13 +112761,13 @@ This function is used to ask the executor to execute the given function object. template< typename ``[link asio.reference.LegacyCompletionHandler LegacyCompletionHandler]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( + auto 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 [link asio.reference.io_context `io_context`]. The [link asio.reference.io_context `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. +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 [link asio.reference.io_context `io_context`]. The [link asio.reference.io_context `io_context`] guarantees that the handler will only be called in a thread in which the [link asio.reference.io_context `io_context`]'s run member function is currently being invoked. [heading Parameters] @@ -113213,7 +112777,7 @@ The strand object guarantees that handlers posted or dispatched through the stra [[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(); + void handler(); `` ]] @@ -113298,9 +112862,9 @@ This function is used to create a new handler function object that, when invoked [variablelist -[[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: +[[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); + void handler(A1 a1, ... An an); `` ]] @@ -113311,22 +112875,22 @@ This function is used to create a new handler function object that, when invoked 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); + R f(A1 a1, ... An an); If this function object is passed to the wrap function like so: - strand.wrap(f); + strand.wrap(f); then the return value is a function object with the signature - void g(A1 a1, ... An an); + void g(A1 a1, ... An an); that, when invoked, executes code equivalent to: - strand.dispatch(boost::bind(f, a1, ... an)); + strand.dispatch(boost::bind(f, a1, ... an)); @@ -113684,26 +113248,9 @@ Typedef for backwards compatibility. [table [[Name][Description]] - [ - [[link asio.reference.io_context.add_service [*add_service]]] - [(Deprecated: Use make_service().) Add a service object to the execution_context. ] - ] - - [ - [[link asio.reference.io_context.has_service [*has_service]]] - [Determine if an execution_context contains a specified service type. ] - ] - - [ - [[link asio.reference.io_context.make_service [*make_service]]] - [Creates a service object and adds it to the execution_context. ] - ] - [ [[link asio.reference.io_context.use_service [*use_service]]] - [ - [hr] - Obtain the service object corresponding to the given type. ] + [] ] ] @@ -113749,20 +113296,20 @@ 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. - } - } + asio::io_context io_context; + ... + for (;;) + { + try + { + io_context.run(); + break; // run() exited normally + } + catch (my_exception& e) + { + // Deal with exception as appropriate. + } + } @@ -113779,26 +113326,26 @@ For example: void my_task() - { - ... - } + { + ... + } - ... + ... - asio::io_context io_context; + asio::io_context io_context; - // Submit a function to the io_context. - asio::post(io_context, my_task); + // 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, - []() - { - ... - }); + // 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(); + // Run the io_context until it runs out of work. + io_context.run(); @@ -113813,9 +113360,9 @@ Some applications may need to prevent an [link asio.reference.io_context `io_con asio::io_context io_context; - asio::executor_work_guard - = asio::make_work_guard(io_context); - ... + asio::executor_work_guard + = asio::make_work_guard(io_context); + ... @@ -113827,10 +113374,10 @@ Alternatively, if the application requires that all operations and handlers be a asio::io_context io_context; - asio::executor_work_guard - = asio::make_work_guard(io_context); - ... - work.reset(); // Allow run() to exit. + asio::executor_work_guard + = asio::make_work_guard(io_context); + ... + work.reset(); // Allow run() to exit. @@ -113869,7 +113416,9 @@ Implements version-independent IP addresses. [hr] Construct an address from an IPv6 address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -113905,6 +113454,8 @@ Implements version-independent IP addresses. [ [[link asio.reference.ip__address.operator_eq_ [*operator=]]] [Assign from another address. + [hr] + Move-assign from another address. [hr] Assign from an IPv4 address. [hr] @@ -114033,7 +113584,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__address.address.overload4 more...]]`` -[section:overload1 ip::address::address (1 of 4 overloads)] +Move constructor. + + + ``[link asio.reference.ip__address.address.overload5 address]``( + address && other); + `` [''''»''' [link asio.reference.ip__address.address.overload5 more...]]`` + + +[section:overload1 ip::address::address (1 of 5 overloads)] Default constructor. @@ -114047,7 +113606,7 @@ Default constructor. -[section:overload2 ip::address::address (2 of 4 overloads)] +[section:overload2 ip::address::address (2 of 5 overloads)] Construct an address from an IPv4 address. @@ -114062,7 +113621,7 @@ Construct an address from an IPv4 address. -[section:overload3 ip::address::address (3 of 4 overloads)] +[section:overload3 ip::address::address (3 of 5 overloads)] Construct an address from an IPv6 address. @@ -114077,7 +113636,7 @@ Construct an address from an IPv6 address. -[section:overload4 ip::address::address (4 of 4 overloads)] +[section:overload4 ip::address::address (4 of 5 overloads)] Copy constructor. @@ -114088,6 +113647,21 @@ Copy constructor. +[endsect] + + + +[section:overload5 ip::address::address (5 of 5 overloads)] + + +Move constructor. + + + address( + address && other); + + + [endsect] @@ -114386,7 +113960,7 @@ Create an address from an IPv4 address string in dotted decimal form, or from an Compare two addresses for inequality. - friend bool operator!=( + bool operator!=( const address & a1, const address & a2); @@ -114408,7 +113982,7 @@ Compare two addresses for inequality. Compare addresses for ordering. - friend bool operator<( + bool operator<( const address & a1, const address & a2); @@ -114470,7 +114044,7 @@ The output stream. Compare addresses for ordering. - friend bool operator<=( + bool operator<=( const address & a1, const address & a2); @@ -114496,23 +114070,31 @@ Assign from another address. `` [''''»''' [link asio.reference.ip__address.operator_eq_.overload1 more...]]`` -Assign from an IPv4 address. +Move-assign from another address. address & ``[link asio.reference.ip__address.operator_eq_.overload2 operator=]``( - const asio::ip::address_v4 & ipv4_address); + address && other); `` [''''»''' [link asio.reference.ip__address.operator_eq_.overload2 more...]]`` -Assign from an IPv6 address. +Assign from an IPv4 address. address & ``[link asio.reference.ip__address.operator_eq_.overload3 operator=]``( - const asio::ip::address_v6 & ipv6_address); + const asio::ip::address_v4 & ipv4_address); `` [''''»''' [link asio.reference.ip__address.operator_eq_.overload3 more...]]`` -[section:overload1 ip::address::operator= (1 of 3 overloads)] +Assign from an IPv6 address. + + + address & ``[link asio.reference.ip__address.operator_eq_.overload4 operator=]``( + const asio::ip::address_v6 & ipv6_address); + `` [''''»''' [link asio.reference.ip__address.operator_eq_.overload4 more...]]`` + + +[section:overload1 ip::address::operator= (1 of 4 overloads)] Assign from another address. @@ -114527,7 +114109,22 @@ Assign from another address. -[section:overload2 ip::address::operator= (2 of 3 overloads)] +[section:overload2 ip::address::operator= (2 of 4 overloads)] + + +Move-assign from another address. + + + address & operator=( + address && other); + + + +[endsect] + + + +[section:overload3 ip::address::operator= (3 of 4 overloads)] Assign from an IPv4 address. @@ -114542,7 +114139,7 @@ Assign from an IPv4 address. -[section:overload3 ip::address::operator= (3 of 3 overloads)] +[section:overload4 ip::address::operator= (4 of 4 overloads)] Assign from an IPv6 address. @@ -114565,7 +114162,7 @@ Assign from an IPv6 address. Compare two addresses for equality. - friend bool operator==( + bool operator==( const address & a1, const address & a2); @@ -114587,7 +114184,7 @@ Compare two addresses for equality. Compare addresses for ordering. - friend bool operator>( + bool operator>( const address & a1, const address & a2); @@ -114609,7 +114206,7 @@ Compare addresses for ordering. Compare addresses for ordering. - friend bool operator>=( + bool operator>=( const address & a1, const address & a2); @@ -114746,7 +114343,9 @@ Implements IP version 4 style addresses. [hr] Construct an address from an unsigned integer in host byte order. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -114808,7 +114407,9 @@ Implements IP version 4 style addresses. [ [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] - [Assign from another address. ] + [Assign from another address. + [hr] + Move-assign from another address. ] ] [ @@ -114953,7 +114554,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__address_v4.address_v4.overload4 more...]]`` -[section:overload1 ip::address_v4::address_v4 (1 of 4 overloads)] +Move constructor. + + + ``[link asio.reference.ip__address_v4.address_v4.overload5 address_v4]``( + address_v4 && other); + `` [''''»''' [link asio.reference.ip__address_v4.address_v4.overload5 more...]]`` + + +[section:overload1 ip::address_v4::address_v4 (1 of 5 overloads)] Default constructor. @@ -114974,7 +114583,7 @@ Initialises the `address_v4` object such that: -[section:overload2 ip::address_v4::address_v4 (2 of 4 overloads)] +[section:overload2 ip::address_v4::address_v4 (2 of 5 overloads)] Construct an address from raw bytes. @@ -115003,7 +114612,7 @@ Initialises the `address_v4` object such that `to_bytes() == bytes`. -[section:overload3 ip::address_v4::address_v4 (3 of 4 overloads)] +[section:overload3 ip::address_v4::address_v4 (3 of 5 overloads)] Construct an address from an unsigned integer in host byte order. @@ -115020,7 +114629,7 @@ Initialises the `address_v4` object such that `to_uint() == addr`. -[section:overload4 ip::address_v4::address_v4 (4 of 4 overloads)] +[section:overload4 ip::address_v4::address_v4 (4 of 5 overloads)] Copy constructor. @@ -115031,6 +114640,21 @@ Copy constructor. +[endsect] + + + +[section:overload5 ip::address_v4::address_v4 (5 of 5 overloads)] + + +Move constructor. + + + address_v4( + address_v4 && other); + + + [endsect] @@ -115643,7 +115267,7 @@ Create an IPv4 network from an address and netmask. Compare two addresses for inequality. - friend bool operator!=( + bool operator!=( const address_v4 & a1, const address_v4 & a2); @@ -115665,7 +115289,7 @@ Compare two addresses for inequality. Compare addresses for ordering. - friend bool operator<( + bool operator<( const address_v4 & a1, const address_v4 & a2); @@ -115804,7 +115428,7 @@ The output stream. Compare addresses for ordering. - friend bool operator<=( + bool operator<=( const address_v4 & a1, const address_v4 & a2); @@ -115828,10 +115452,28 @@ Compares two addresses in host byte order. [endsect] - [section:operator_eq_ ip::address_v4::operator=] [indexterm2 asio.indexterm.ip__address_v4.operator_eq_..operator=..ip::address_v4] +Assign from another address. + + + address_v4 & ``[link asio.reference.ip__address_v4.operator_eq_.overload1 operator=]``( + const address_v4 & other); + `` [''''»''' [link asio.reference.ip__address_v4.operator_eq_.overload1 more...]]`` + + +Move-assign from another address. + + + address_v4 & ``[link asio.reference.ip__address_v4.operator_eq_.overload2 operator=]``( + address_v4 && other); + `` [''''»''' [link asio.reference.ip__address_v4.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::address_v4::operator= (1 of 2 overloads)] + + Assign from another address. @@ -115844,13 +115486,30 @@ Assign from another address. +[section:overload2 ip::address_v4::operator= (2 of 2 overloads)] + + +Move-assign from another address. + + + address_v4 & operator=( + address_v4 && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::address_v4::operator==] [indexterm2 asio.indexterm.ip__address_v4.operator_eq__eq_..operator==..ip::address_v4] Compare two addresses for equality. - friend bool operator==( + bool operator==( const address_v4 & a1, const address_v4 & a2); @@ -115872,7 +115531,7 @@ Compare two addresses for equality. Compare addresses for ordering. - friend bool operator>( + bool operator>( const address_v4 & a1, const address_v4 & a2); @@ -115903,7 +115562,7 @@ Compares two addresses in host byte order. Compare addresses for ordering. - friend bool operator>=( + bool operator>=( const address_v4 & a1, const address_v4 & a2); @@ -116101,11 +115760,13 @@ An input iterator that can be used for traversing IPv4 addresses. [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator [*basic_address_iterator]]] [Construct an iterator that points to the specified address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ - [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_star_ [*operator*]]] [Dereference the iterator. ] ] @@ -116130,7 +115791,9 @@ An input iterator that can be used for traversing IPv4 addresses. [ [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -116207,7 +115870,9 @@ Represents a range of IPv4 addresses. [hr] Construct an range that represents the given range of addresses. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -116232,7 +115897,9 @@ Represents a range of IPv4 addresses. [ [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] [ @@ -116296,7 +115963,9 @@ Implements IP version 6 style addresses. [hr] Construct an address from raw bytes and scope ID. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -116376,7 +116045,9 @@ Implements IP version 6 style addresses. [ [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] - [Assign from another address. ] + [Assign from another address. + [hr] + Move-assign from another address. ] ] [ @@ -116522,7 +116193,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__address_v6.address_v6.overload3 more...]]`` -[section:overload1 ip::address_v6::address_v6 (1 of 3 overloads)] +Move constructor. + + + ``[link asio.reference.ip__address_v6.address_v6.overload4 address_v6]``( + address_v6 && other); + `` [''''»''' [link asio.reference.ip__address_v6.address_v6.overload4 more...]]`` + + +[section:overload1 ip::address_v6::address_v6 (1 of 4 overloads)] Default constructor. @@ -116543,7 +116222,7 @@ Initialises the `address_v6` object such that: -[section:overload2 ip::address_v6::address_v6 (2 of 3 overloads)] +[section:overload2 ip::address_v6::address_v6 (2 of 4 overloads)] Construct an address from raw bytes and scope ID. @@ -116576,7 +116255,7 @@ Initialises the `address_v6` object such that: -[section:overload3 ip::address_v6::address_v6 (3 of 3 overloads)] +[section:overload3 ip::address_v6::address_v6 (3 of 4 overloads)] Copy constructor. @@ -116587,6 +116266,21 @@ Copy constructor. +[endsect] + + + +[section:overload4 ip::address_v6::address_v6 (4 of 4 overloads)] + + +Move constructor. + + + address_v6( + address_v6 && other); + + + [endsect] @@ -117124,7 +116818,7 @@ Create an IPv6 network from an address and prefix length. Compare two addresses for inequality. - friend bool operator!=( + bool operator!=( const address_v6 & a1, const address_v6 & a2); @@ -117146,7 +116840,7 @@ Compare two addresses for inequality. Compare addresses for ordering. - friend bool operator<( + bool operator<( const address_v6 & a1, const address_v6 & a2); @@ -117276,7 +116970,7 @@ The output stream. Compare addresses for ordering. - friend bool operator<=( + bool operator<=( const address_v6 & a1, const address_v6 & a2); @@ -117291,10 +116985,28 @@ Compare addresses for ordering. [endsect] - [section:operator_eq_ ip::address_v6::operator=] [indexterm2 asio.indexterm.ip__address_v6.operator_eq_..operator=..ip::address_v6] +Assign from another address. + + + address_v6 & ``[link asio.reference.ip__address_v6.operator_eq_.overload1 operator=]``( + const address_v6 & other); + `` [''''»''' [link asio.reference.ip__address_v6.operator_eq_.overload1 more...]]`` + + +Move-assign from another address. + + + address_v6 & ``[link asio.reference.ip__address_v6.operator_eq_.overload2 operator=]``( + address_v6 && other); + `` [''''»''' [link asio.reference.ip__address_v6.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::address_v6::operator= (1 of 2 overloads)] + + Assign from another address. @@ -117307,13 +117019,30 @@ Assign from another address. +[section:overload2 ip::address_v6::operator= (2 of 2 overloads)] + + +Move-assign from another address. + + + address_v6 & operator=( + address_v6 && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::address_v6::operator==] [indexterm2 asio.indexterm.ip__address_v6.operator_eq__eq_..operator==..ip::address_v6] Compare two addresses for equality. - friend bool operator==( + bool operator==( const address_v6 & a1, const address_v6 & a2); @@ -117335,7 +117064,7 @@ Compare two addresses for equality. Compare addresses for ordering. - friend bool operator>( + bool operator>( const address_v6 & a1, const address_v6 & a2); @@ -117357,7 +117086,7 @@ Compare addresses for ordering. Compare addresses for ordering. - friend bool operator>=( + bool operator>=( const address_v6 & a1, const address_v6 & a2); @@ -117498,7 +117227,7 @@ Get the address as a string. [section:to_v4 ip::address_v6::to_v4] [indexterm2 asio.indexterm.ip__address_v6.to_v4..to_v4..ip::address_v6] -(Deprecated: Use `make_address_v4()`.) Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. +(Deprecated: Use make\_address\_v4().) Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. address_v4 to_v4() const; @@ -117601,11 +117330,13 @@ An input iterator that can be used for traversing IPv6 addresses. [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator [*basic_address_iterator]]] [Construct an iterator that points to the specified address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ - [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_star_ [*operator*]]] [Dereference the iterator. ] ] @@ -117630,7 +117361,9 @@ An input iterator that can be used for traversing IPv6 addresses. [ [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -117707,7 +117440,9 @@ Represents a range of IPv6 addresses. [hr] Construct an range that represents the given range of addresses. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -117732,7 +117467,9 @@ Represents a range of IPv6 addresses. [ [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -117765,7 +117502,8 @@ Represents a range of IPv6 addresses. Thrown to indicate a failed address conversion. - class bad_address_cast + class bad_address_cast : + public std::bad_cast [heading Member Functions] @@ -117874,6 +117612,26 @@ Destructor. +[endsect] + +[section:ip__basic_address_iterator ip::basic_address_iterator] + +[indexterm1 asio.indexterm.ip__basic_address_iterator..ip::basic_address_iterator] + + + + template< + > + class basic_address_iterator + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + [endsect] [section:ip__basic_address_iterator_lt__address_v4__gt_ ip::basic_address_iterator< address_v4 >] @@ -117937,11 +117695,13 @@ An input iterator that can be used for traversing IPv4 addresses. [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator [*basic_address_iterator]]] [Construct an iterator that points to the specified address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ - [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_star_ [*operator*]]] [Dereference the iterator. ] ] @@ -117966,7 +117726,9 @@ An input iterator that can be used for traversing IPv4 addresses. [ [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -118023,7 +117785,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload2 more...]]`` -[section:overload1 ip::basic_address_iterator< address_v4 >::basic_address_iterator (1 of 2 overloads)] +Move constructor. + + + ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload3 basic_address_iterator]``( + basic_address_iterator && other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload3 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v4 >::basic_address_iterator (1 of 3 overloads)] Construct an iterator that points to the specified address. @@ -118038,7 +117808,7 @@ Construct an iterator that points to the specified address. -[section:overload2 ip::basic_address_iterator< address_v4 >::basic_address_iterator (2 of 2 overloads)] +[section:overload2 ip::basic_address_iterator< address_v4 >::basic_address_iterator (2 of 3 overloads)] Copy constructor. @@ -118049,6 +117819,21 @@ Copy constructor. +[endsect] + + + +[section:overload3 ip::basic_address_iterator< address_v4 >::basic_address_iterator (3 of 3 overloads)] + + +Move constructor. + + + basic_address_iterator( + basic_address_iterator && other); + + + [endsect] @@ -118097,36 +117882,36 @@ Denotes that the iterator satisfies the input iterator requirements. -[section:operator__star_ ip::basic_address_iterator< address_v4 >::operator *] +[section:operator_not__eq_ ip::basic_address_iterator< address_v4 >::operator!=] -[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v4__gt_.operator__star_..operator *..ip::basic_address_iterator< address_v4 >] -Dereference the iterator. +[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v4__gt_.operator_not__eq_..operator!=..ip::basic_address_iterator< address_v4 >] +Compare two addresses for inequality. - const address_v4 & operator *() const; + bool operator!=( + const basic_address_iterator & a, + const basic_address_iterator & b); +[heading Requirements] -[endsect] +['Header: ][^asio/ip/address_v4_iterator.hpp] +['Convenience header: ][^asio.hpp] -[section:operator_not__eq_ ip::basic_address_iterator< address_v4 >::operator!=] +[endsect] -[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v4__gt_.operator_not__eq_..operator!=..ip::basic_address_iterator< address_v4 >] -Compare two addresses for inequality. - friend bool operator!=( - const basic_address_iterator & a, - const basic_address_iterator & b); +[section:operator_star_ ip::basic_address_iterator< address_v4 >::operator*] +[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v4__gt_.operator_star_..operator*..ip::basic_address_iterator< address_v4 >] +Dereference the iterator. -[heading Requirements] -['Header: ][^asio/ip/address_v4_iterator.hpp] + const address_v4 & operator*() const; -['Convenience header: ][^asio.hpp] [endsect] @@ -118242,10 +118027,28 @@ Dereference the iterator. [endsect] - [section:operator_eq_ ip::basic_address_iterator< address_v4 >::operator=] [indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_..operator=..ip::basic_address_iterator< address_v4 >] +Assignment operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_.overload1 operator=]``( + const basic_address_iterator & other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_.overload1 more...]]`` + + +Move assignment operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_.overload2 operator=]``( + basic_address_iterator && other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v4 >::operator= (1 of 2 overloads)] + + Assignment operator. @@ -118258,13 +118061,30 @@ Assignment operator. +[section:overload2 ip::basic_address_iterator< address_v4 >::operator= (2 of 2 overloads)] + + +Move assignment operator. + + + basic_address_iterator & operator=( + basic_address_iterator && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::basic_address_iterator< address_v4 >::operator==] [indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq__eq_..operator==..ip::basic_address_iterator< address_v4 >] Compare two addresses for equality. - friend bool operator==( + bool operator==( const basic_address_iterator & a, const basic_address_iterator & b); @@ -118342,7 +118162,9 @@ The type of a reference to an element pointed to by the iterator. [hr] Construct an address from an unsigned integer in host byte order. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -118404,7 +118226,9 @@ The type of a reference to an element pointed to by the iterator. [ [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] - [Assign from another address. ] + [Assign from another address. + [hr] + Move-assign from another address. ] ] [ @@ -118562,7 +118386,9 @@ The type of the elements pointed to by the iterator. [hr] Construct an address from an unsigned integer in host byte order. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -118624,7 +118450,9 @@ The type of the elements pointed to by the iterator. [ [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] - [Assign from another address. ] + [Assign from another address. + [hr] + Move-assign from another address. ] ] [ @@ -118804,11 +118632,13 @@ An input iterator that can be used for traversing IPv6 addresses. [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator [*basic_address_iterator]]] [Construct an iterator that points to the specified address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ - [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_star_ [*operator*]]] [Dereference the iterator. ] ] @@ -118833,7 +118663,9 @@ An input iterator that can be used for traversing IPv6 addresses. [ [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -118890,7 +118722,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload2 more...]]`` -[section:overload1 ip::basic_address_iterator< address_v6 >::basic_address_iterator (1 of 2 overloads)] +Move constructor. + + + ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload3 basic_address_iterator]``( + basic_address_iterator && other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload3 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v6 >::basic_address_iterator (1 of 3 overloads)] Construct an iterator that points to the specified address. @@ -118905,7 +118745,7 @@ Construct an iterator that points to the specified address. -[section:overload2 ip::basic_address_iterator< address_v6 >::basic_address_iterator (2 of 2 overloads)] +[section:overload2 ip::basic_address_iterator< address_v6 >::basic_address_iterator (2 of 3 overloads)] Copy constructor. @@ -118916,6 +118756,21 @@ Copy constructor. +[endsect] + + + +[section:overload3 ip::basic_address_iterator< address_v6 >::basic_address_iterator (3 of 3 overloads)] + + +Move constructor. + + + basic_address_iterator( + basic_address_iterator && other); + + + [endsect] @@ -118964,36 +118819,36 @@ Denotes that the iterator satisfies the input iterator requirements. -[section:operator__star_ ip::basic_address_iterator< address_v6 >::operator *] +[section:operator_not__eq_ ip::basic_address_iterator< address_v6 >::operator!=] -[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v6__gt_.operator__star_..operator *..ip::basic_address_iterator< address_v6 >] -Dereference the iterator. +[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v6__gt_.operator_not__eq_..operator!=..ip::basic_address_iterator< address_v6 >] +Compare two addresses for inequality. - const address_v6 & operator *() const; + bool operator!=( + const basic_address_iterator & a, + const basic_address_iterator & b); +[heading Requirements] -[endsect] +['Header: ][^asio/ip/address_v6_iterator.hpp] +['Convenience header: ][^asio.hpp] -[section:operator_not__eq_ ip::basic_address_iterator< address_v6 >::operator!=] +[endsect] -[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v6__gt_.operator_not__eq_..operator!=..ip::basic_address_iterator< address_v6 >] -Compare two addresses for inequality. - friend bool operator!=( - const basic_address_iterator & a, - const basic_address_iterator & b); +[section:operator_star_ ip::basic_address_iterator< address_v6 >::operator*] +[indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v6__gt_.operator_star_..operator*..ip::basic_address_iterator< address_v6 >] +Dereference the iterator. -[heading Requirements] -['Header: ][^asio/ip/address_v6_iterator.hpp] + const address_v6 & operator*() const; -['Convenience header: ][^asio.hpp] [endsect] @@ -119109,10 +118964,28 @@ Dereference the iterator. [endsect] - [section:operator_eq_ ip::basic_address_iterator< address_v6 >::operator=] [indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_..operator=..ip::basic_address_iterator< address_v6 >] +Assignment operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_.overload1 operator=]``( + const basic_address_iterator & other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_.overload1 more...]]`` + + +Move assignment operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_.overload2 operator=]``( + basic_address_iterator && other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v6 >::operator= (1 of 2 overloads)] + + Assignment operator. @@ -119125,13 +118998,30 @@ Assignment operator. +[section:overload2 ip::basic_address_iterator< address_v6 >::operator= (2 of 2 overloads)] + + +Move assignment operator. + + + basic_address_iterator & operator=( + basic_address_iterator && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::basic_address_iterator< address_v6 >::operator==] [indexterm2 asio.indexterm.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq__eq_..operator==..ip::basic_address_iterator< address_v6 >] Compare two addresses for equality. - friend bool operator==( + bool operator==( const basic_address_iterator & a, const basic_address_iterator & b); @@ -119200,7 +119090,9 @@ The type of a reference to an element pointed to by the iterator. [hr] Construct an address from raw bytes and scope ID. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -119280,7 +119172,9 @@ The type of a reference to an element pointed to by the iterator. [ [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] - [Assign from another address. ] + [Assign from another address. + [hr] + Move-assign from another address. ] ] [ @@ -119437,7 +119331,9 @@ The type of the elements pointed to by the iterator. [hr] Construct an address from raw bytes and scope ID. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -119517,7 +119413,9 @@ The type of the elements pointed to by the iterator. [ [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] - [Assign from another address. ] + [Assign from another address. + [hr] + Move-assign from another address. ] ] [ @@ -119642,6 +119540,26 @@ The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the abi +[endsect] + +[section:ip__basic_address_range ip::basic_address_range] + +[indexterm1 asio.indexterm.ip__basic_address_range..ip::basic_address_range] + + + + template< + > + class basic_address_range + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_range.hpp] + +['Convenience header: ][^asio.hpp] + + [endsect] [section:ip__basic_address_range_lt__address_v4__gt_ ip::basic_address_range< address_v4 >] @@ -119679,7 +119597,9 @@ Represents a range of IPv4 addresses. [hr] Construct an range that represents the given range of addresses. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -119704,7 +119624,9 @@ Represents a range of IPv4 addresses. [ [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] [ @@ -119756,7 +119678,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload3 more...]]`` -[section:overload1 ip::basic_address_range< address_v4 >::basic_address_range (1 of 3 overloads)] +Move constructor. + + + ``[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload4 basic_address_range]``( + basic_address_range && other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload4 more...]]`` + + +[section:overload1 ip::basic_address_range< address_v4 >::basic_address_range (1 of 4 overloads)] Construct an empty range. @@ -119770,7 +119700,7 @@ Construct an empty range. -[section:overload2 ip::basic_address_range< address_v4 >::basic_address_range (2 of 3 overloads)] +[section:overload2 ip::basic_address_range< address_v4 >::basic_address_range (2 of 4 overloads)] Construct an range that represents the given range of addresses. @@ -119786,7 +119716,7 @@ Construct an range that represents the given range of addresses. -[section:overload3 ip::basic_address_range< address_v4 >::basic_address_range (3 of 3 overloads)] +[section:overload3 ip::basic_address_range< address_v4 >::basic_address_range (3 of 4 overloads)] Copy constructor. @@ -119797,6 +119727,21 @@ Copy constructor. +[endsect] + + + +[section:overload4 ip::basic_address_range< address_v4 >::basic_address_range (4 of 4 overloads)] + + +Move constructor. + + + basic_address_range( + basic_address_range && other); + + + [endsect] @@ -119918,11 +119863,13 @@ The type of an iterator that points into the range. [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator [*basic_address_iterator]]] [Construct an iterator that points to the specified address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ - [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_star_ [*operator*]]] [Dereference the iterator. ] ] @@ -119947,7 +119894,9 @@ The type of an iterator that points into the range. [ [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -119990,10 +119939,28 @@ In addition to satisfying the input iterator requirements, this iterator also su [endsect] - [section:operator_eq_ ip::basic_address_range< address_v4 >::operator=] [indexterm2 asio.indexterm.ip__basic_address_range_lt__address_v4__gt_.operator_eq_..operator=..ip::basic_address_range< address_v4 >] +Assignment operator. + + + basic_address_range & ``[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_.overload1 operator=]``( + const basic_address_range & other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_.overload1 more...]]`` + + +Move assignment operator. + + + basic_address_range & ``[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_.overload2 operator=]``( + basic_address_range && other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_range< address_v4 >::operator= (1 of 2 overloads)] + + Assignment operator. @@ -120006,6 +119973,23 @@ Assignment operator. +[section:overload2 ip::basic_address_range< address_v4 >::operator= (2 of 2 overloads)] + + +Move assignment operator. + + + basic_address_range & operator=( + basic_address_range && other); + + + +[endsect] + + +[endsect] + + [section:size ip::basic_address_range< address_v4 >::size] [indexterm2 asio.indexterm.ip__basic_address_range_lt__address_v4__gt_.size..size..ip::basic_address_range< address_v4 >] @@ -120057,7 +120041,9 @@ Represents a range of IPv6 addresses. [hr] Construct an range that represents the given range of addresses. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -120082,7 +120068,9 @@ Represents a range of IPv6 addresses. [ [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -120129,7 +120117,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload3 more...]]`` -[section:overload1 ip::basic_address_range< address_v6 >::basic_address_range (1 of 3 overloads)] +Move constructor. + + + ``[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload4 basic_address_range]``( + basic_address_range && other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload4 more...]]`` + + +[section:overload1 ip::basic_address_range< address_v6 >::basic_address_range (1 of 4 overloads)] Construct an empty range. @@ -120143,7 +120139,7 @@ Construct an empty range. -[section:overload2 ip::basic_address_range< address_v6 >::basic_address_range (2 of 3 overloads)] +[section:overload2 ip::basic_address_range< address_v6 >::basic_address_range (2 of 4 overloads)] Construct an range that represents the given range of addresses. @@ -120159,7 +120155,7 @@ Construct an range that represents the given range of addresses. -[section:overload3 ip::basic_address_range< address_v6 >::basic_address_range (3 of 3 overloads)] +[section:overload3 ip::basic_address_range< address_v6 >::basic_address_range (3 of 4 overloads)] Copy constructor. @@ -120170,6 +120166,21 @@ Copy constructor. +[endsect] + + + +[section:overload4 ip::basic_address_range< address_v6 >::basic_address_range (4 of 4 overloads)] + + +Move constructor. + + + basic_address_range( + basic_address_range && other); + + + [endsect] @@ -120291,11 +120302,13 @@ The type of an iterator that points into the range. [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator [*basic_address_iterator]]] [Construct an iterator that points to the specified address. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ - [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_star_ [*operator*]]] [Dereference the iterator. ] ] @@ -120320,7 +120333,9 @@ The type of an iterator that points into the range. [ [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_ [*operator=]]] - [Assignment operator. ] + [Assignment operator. + [hr] + Move assignment operator. ] ] ] @@ -120363,10 +120378,28 @@ In addition to satisfying the input iterator requirements, this iterator also su [endsect] - [section:operator_eq_ ip::basic_address_range< address_v6 >::operator=] [indexterm2 asio.indexterm.ip__basic_address_range_lt__address_v6__gt_.operator_eq_..operator=..ip::basic_address_range< address_v6 >] +Assignment operator. + + + basic_address_range & ``[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_.overload1 operator=]``( + const basic_address_range & other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_.overload1 more...]]`` + + +Move assignment operator. + + + basic_address_range & ``[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_.overload2 operator=]``( + basic_address_range && other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_range< address_v6 >::operator= (1 of 2 overloads)] + + Assignment operator. @@ -120379,6 +120412,23 @@ Assignment operator. +[section:overload2 ip::basic_address_range< address_v6 >::operator= (2 of 2 overloads)] + + +Move assignment operator. + + + basic_address_range & operator=( + basic_address_range && other); + + + +[endsect] + + +[endsect] + + [endsect] [section:ip__basic_endpoint ip::basic_endpoint] @@ -120666,14 +120716,14 @@ Construct an endpoint using a port number, specified in the host's byte order. T To initialise an IPv4 TCP endpoint for port 1234, use: - asio::ip::tcp::endpoint ep(asio::ip::tcp::v4(), 1234); + 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); + asio::ip::udp::endpoint ep(asio::ip::udp::v6(), 9876); @@ -120814,7 +120864,7 @@ The type of the endpoint structure. This type is dependent on the underlying imp Compare two endpoints for inequality. - friend bool operator!=( + bool operator!=( const basic_endpoint< InternetProtocol > & e1, const basic_endpoint< InternetProtocol > & e2); @@ -120836,7 +120886,7 @@ Compare two endpoints for inequality. Compare endpoints for ordering. - friend bool operator<( + bool operator<( const basic_endpoint< InternetProtocol > & e1, const basic_endpoint< InternetProtocol > & e2); @@ -120858,6 +120908,10 @@ Compare endpoints for ordering. Output an endpoint as a string. + template< + typename Elem, + typename Traits, + typename ``[link asio.reference.InternetProtocol InternetProtocol]``> std::basic_ostream< Elem, Traits > & operator<<( std::basic_ostream< Elem, Traits > & os, const basic_endpoint< InternetProtocol > & endpoint); @@ -120895,7 +120949,7 @@ The output stream. Compare endpoints for ordering. - friend bool operator<=( + bool operator<=( const basic_endpoint< InternetProtocol > & e1, const basic_endpoint< InternetProtocol > & e2); @@ -120967,7 +121021,7 @@ Move-assign from another endpoint. Compare two endpoints for equality. - friend bool operator==( + bool operator==( const basic_endpoint< InternetProtocol > & e1, const basic_endpoint< InternetProtocol > & e2); @@ -120989,7 +121043,7 @@ Compare two endpoints for equality. Compare endpoints for ordering. - friend bool operator>( + bool operator>( const basic_endpoint< InternetProtocol > & e1, const basic_endpoint< InternetProtocol > & e2); @@ -121011,7 +121065,7 @@ Compare endpoints for ordering. Compare endpoints for ordering. - friend bool operator>=( + bool operator>=( const basic_endpoint< InternetProtocol > & e1, const basic_endpoint< InternetProtocol > & e2); @@ -121370,10 +121424,10 @@ If used with v4\_mapped, return all matching IPv6 and IPv4 addresses. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload1 async_resolve]``( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto ``[link asio.reference.ip__basic_resolver.async_resolve.overload1 async_resolve]``( const query & q, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload1 more...]]`` @@ -121381,39 +121435,39 @@ Asynchronously perform forward resolution of a query to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload2 async_resolve]``( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto ``[link asio.reference.ip__basic_resolver.async_resolve.overload2 async_resolve]``( string_view host, string_view service, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload2 more...]]`` template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload3 async_resolve]``( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto ``[link asio.reference.ip__basic_resolver.async_resolve.overload3 async_resolve]``( string_view host, string_view service, resolver_base::flags resolve_flags, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload3 more...]]`` template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload4 async_resolve]``( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto ``[link asio.reference.ip__basic_resolver.async_resolve.overload4 async_resolve]``( const protocol_type & protocol, string_view host, string_view service, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload4 more...]]`` template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload5 async_resolve]``( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto ``[link asio.reference.ip__basic_resolver.async_resolve.overload5 async_resolve]``( const protocol_type & protocol, string_view host, string_view service, resolver_base::flags resolve_flags, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload5 more...]]`` @@ -121421,10 +121475,10 @@ Asynchronously perform reverse resolution of an endpoint to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload6 async_resolve]``( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto ``[link asio.reference.ip__basic_resolver.async_resolve.overload6 async_resolve]``( const endpoint_type & e, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload6 more...]]`` @@ -121435,10 +121489,10 @@ Asynchronously perform reverse resolution of an endpoint to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_resolve( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto async_resolve( const query & q, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously resolve a query into a list of endpoint entries. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -121454,9 +121508,9 @@ This function is used to asynchronously resolve a query into a list of endpoint [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the resolve completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - resolver::results_type results // Resolved endpoints as a range. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -121469,7 +121523,7 @@ A successful resolve operation is guaranteed to pass a non-empty range to the ha - void(asio::error_code, results_type) + void(asio::error_code, results_type) @@ -121488,11 +121542,11 @@ Asynchronously perform forward resolution of a query to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_resolve( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto async_resolve( string_view host, string_view service, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); This function is used to resolve host and service names into a list of endpoint entries. @@ -121510,9 +121564,9 @@ This function is used to resolve host and service names into a list of endpoint [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the resolve completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - resolver::results_type results // Resolved endpoints as a range. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -121525,7 +121579,7 @@ A successful resolve operation is guaranteed to pass a non-empty range to the ha - void(asio::error_code, results_type) + void(asio::error_code, results_type) @@ -121549,12 +121603,12 @@ Asynchronously perform forward resolution of a query to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_resolve( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto async_resolve( string_view host, string_view service, resolver_base::flags resolve_flags, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); This function is used to resolve host and service names into a list of endpoint entries. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -121574,9 +121628,9 @@ This function is used to resolve host and service names into a list of endpoint [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the resolve completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - resolver::results_type results // Resolved endpoints as a range. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -121589,7 +121643,7 @@ A successful resolve operation is guaranteed to pass a non-empty range to the ha - void(asio::error_code, results_type) + void(asio::error_code, results_type) @@ -121613,12 +121667,12 @@ Asynchronously perform forward resolution of a query to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_resolve( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto async_resolve( const protocol_type & protocol, string_view host, string_view service, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); This function is used to resolve host and service names into a list of endpoint entries. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -121638,9 +121692,9 @@ This function is used to resolve host and service names into a list of endpoint [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the resolve completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - resolver::results_type results // Resolved endpoints as a range. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -121653,7 +121707,7 @@ A successful resolve operation is guaranteed to pass a non-empty range to the ha - void(asio::error_code, results_type) + void(asio::error_code, results_type) @@ -121677,13 +121731,13 @@ Asynchronously perform forward resolution of a query to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_resolve( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto async_resolve( const protocol_type & protocol, string_view host, string_view service, resolver_base::flags resolve_flags, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); This function is used to resolve host and service names into a list of endpoint entries. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -121705,9 +121759,9 @@ This function is used to resolve host and service names into a list of endpoint [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the resolve completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - resolver::results_type results // Resolved endpoints as a range. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -121720,7 +121774,7 @@ A successful resolve operation is guaranteed to pass a non-empty range to the ha - void(asio::error_code, results_type) + void(asio::error_code, results_type) @@ -121744,10 +121798,10 @@ Asynchronously perform reverse resolution of an endpoint to a list of entries. template< - typename ``[link asio.reference.ResolveToken ResolveToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_resolve( + typename ``[link asio.reference.ResolveToken ResolveToken]`` = default_completion_token_t> + auto async_resolve( const endpoint_type & e, - ResolveToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ResolveToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously resolve an endpoint into a list of endpoint entries. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -121763,9 +121817,9 @@ This function is used to asynchronously resolve an endpoint into a list of endpo [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the resolve completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - resolver::results_type results // Resolved endpoints as a range. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -121778,7 +121832,7 @@ A successful resolve operation is guaranteed to pass a non-empty range to the ha - void(asio::error_code, results_type) + void(asio::error_code, results_type) @@ -121809,7 +121863,7 @@ Construct with execution context. typename ExecutionContext> explicit ``[link asio.reference.ip__basic_resolver.basic_resolver.overload2 basic_resolver]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.ip__basic_resolver.basic_resolver.overload2 more...]]`` @@ -121824,7 +121878,7 @@ Move-construct a [link asio.reference.ip__basic_resolver `ip::basic_resolver`] f typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.ip__basic_resolver.basic_resolver.overload4 basic_resolver]``( basic_resolver< InternetProtocol, Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Executor1, Executor >::value > = 0); `` [''''»''' [link asio.reference.ip__basic_resolver.basic_resolver.overload4 more...]]`` @@ -121867,7 +121921,7 @@ Construct with execution context. typename ExecutionContext> basic_resolver( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a [link asio.reference.ip__basic_resolver `ip::basic_resolver`]. @@ -121914,7 +121968,7 @@ This constructor moves a resolver from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&)` constructor. @@ -121933,7 +121987,7 @@ Move-construct a [link asio.reference.ip__basic_resolver `ip::basic_resolver`] f typename ``[link asio.reference.Executor1 Executor1]``> basic_resolver( basic_resolver< InternetProtocol, Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value >::type = 0); + constraint_t< is_convertible< Executor1, Executor >::value > = 0); This constructor moves a resolver from one object to another. @@ -121951,7 +122005,7 @@ This constructor moves a resolver from one object to another. [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&)` constructor. @@ -122139,7 +122193,7 @@ Get the executor associated with the object. ] [ - [[link asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_resolver_iterator.operator_star_ [*operator*]]] [Dereference an iterator. ] ] @@ -122221,7 +122275,7 @@ The [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterato The iterator's value\_type, obtained when the iterator is dereferenced, is: - const basic_resolver_entry + const basic_resolver_entry @@ -122292,7 +122346,7 @@ Move-assign a [link asio.reference.ip__basic_resolver `ip::basic_resolver`] from template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_resolver & >::type ``[link asio.reference.ip__basic_resolver.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_resolver & > ``[link asio.reference.ip__basic_resolver.operator_eq_.overload2 operator=]``( basic_resolver< InternetProtocol, Executor1 > && other); `` [''''»''' [link asio.reference.ip__basic_resolver.operator_eq_.overload2 more...]]`` @@ -122322,7 +122376,7 @@ This assignment operator moves a resolver from one object to another. Cancels an [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&)` constructor. @@ -122339,7 +122393,7 @@ Move-assign a [link asio.reference.ip__basic_resolver `ip::basic_resolver`] from template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_resolver & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_resolver & > operator=( basic_resolver< InternetProtocol, Executor1 > && other); @@ -122358,7 +122412,7 @@ This assignment operator moves a resolver from one object to another. Cancels an [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_resolver(const executor_type&)` constructor. @@ -123328,7 +123382,7 @@ The results type. ] [ - [[link asio.reference.ip__basic_resolver_results.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_resolver_results.operator_star_ [*operator*]]] [Dereference an iterator. ] ] @@ -123418,9 +123472,9 @@ The results type. The [link asio.reference.ip__basic_resolver_results `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: +The iterator's value\_type, obtained when a results iterator is dereferenced, is: - const basic_resolver_entry + const basic_resolver_entry @@ -124081,7 +124135,7 @@ An iterator over the entries produced by a resolver. ] [ - [[link asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_resolver_iterator.operator_star_ [*operator*]]] [Dereference an iterator. ] ] @@ -124163,7 +124217,7 @@ The [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterato The iterator's value\_type, obtained when the iterator is dereferenced, is: - const basic_resolver_entry + const basic_resolver_entry @@ -124346,36 +124400,36 @@ The iterator category. -[section:operator__star_ ip::basic_resolver_iterator::operator *] +[section:operator_not__eq_ ip::basic_resolver_iterator::operator!=] -[indexterm2 asio.indexterm.ip__basic_resolver_iterator.operator__star_..operator *..ip::basic_resolver_iterator] -Dereference an iterator. +[indexterm2 asio.indexterm.ip__basic_resolver_iterator.operator_not__eq_..operator!=..ip::basic_resolver_iterator] +Test two iterators for inequality. - const basic_resolver_entry< InternetProtocol > & operator *() const; + bool operator!=( + const basic_resolver_iterator & a, + const basic_resolver_iterator & b); +[heading Requirements] -[endsect] +['Header: ][^asio/ip/basic_resolver_iterator.hpp] +['Convenience header: ][^asio.hpp] -[section:operator_not__eq_ ip::basic_resolver_iterator::operator!=] +[endsect] -[indexterm2 asio.indexterm.ip__basic_resolver_iterator.operator_not__eq_..operator!=..ip::basic_resolver_iterator] -Test two iterators for inequality. - friend bool operator!=( - const basic_resolver_iterator & a, - const basic_resolver_iterator & b); +[section:operator_star_ ip::basic_resolver_iterator::operator*] +[indexterm2 asio.indexterm.ip__basic_resolver_iterator.operator_star_..operator*..ip::basic_resolver_iterator] +Dereference an iterator. -[heading Requirements] -['Header: ][^asio/ip/basic_resolver_iterator.hpp] + const basic_resolver_entry< InternetProtocol > & operator*() const; -['Convenience header: ][^asio.hpp] [endsect] @@ -124500,7 +124554,7 @@ Move-assignment operator. Test two iterators for equality. - friend bool operator==( + bool operator==( const basic_resolver_iterator & a, const basic_resolver_iterator & b); @@ -125399,7 +125453,7 @@ A range of entries produced by a resolver. ] [ - [[link asio.reference.ip__basic_resolver_results.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_resolver_results.operator_star_ [*operator*]]] [Dereference an iterator. ] ] @@ -125489,9 +125543,9 @@ A range of entries produced by a resolver. The [link asio.reference.ip__basic_resolver_results `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: +The iterator's value\_type, obtained when a results iterator is dereferenced, is: - const basic_resolver_entry + const basic_resolver_entry @@ -125694,7 +125748,7 @@ The type of an iterator into the range. ] [ - [[link asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]] + [[link asio.reference.ip__basic_resolver_iterator.operator_star_ [*operator*]]] [Dereference an iterator. ] ] @@ -125776,7 +125830,7 @@ The [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterato The iterator's value\_type, obtained when the iterator is dereferenced, is: - const basic_resolver_entry + const basic_resolver_entry @@ -125811,70 +125865,6 @@ The type of a const reference to a value in the range. typedef const value_type & const_reference; -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]] - [The endpoint type associated with the endpoint entry. ] - - ] - - [ - - [[link asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]] - [The protocol type associated with the endpoint entry. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]] [constructor]] - [Default constructor. - [hr] - Construct with specified endpoint, host name and service name. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]] - [Get the endpoint associated with the entry. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.host_name [*host_name]]] - [Get the host name associated with the entry. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]] - [Convert to the endpoint associated with the entry. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.service_name [*service_name]]] - [Get the service name associated with the entry. ] - ] - -] - -The [link asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - [heading Requirements] @@ -126027,157 +126017,6 @@ The type of an iterator into the range. typedef const_iterator iterator; -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__basic_resolver_iterator.difference_type [*difference_type]]] - [The type used for the distance between two iterators. ] - - ] - - [ - - [[link asio.reference.ip__basic_resolver_iterator.iterator_category [*iterator_category]]] - [The iterator category. ] - - ] - - [ - - [[link asio.reference.ip__basic_resolver_iterator.pointer [*pointer]]] - [The type of the result of applying operator->() to the iterator. ] - - ] - - [ - - [[link asio.reference.ip__basic_resolver_iterator.reference [*reference]]] - [The type of the result of applying operator*() to the iterator. ] - - ] - - [ - - [[link asio.reference.ip__basic_resolver_iterator.value_type [*value_type]]] - [The type of the value pointed to by the iterator. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]] [constructor]] - [Default constructor creates an end iterator. - [hr] - Copy constructor. - [hr] - Move constructor. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]] - [Dereference an iterator. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]] - [Increment operator (prefix). - [hr] - Increment operator (postfix). ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]] - [Dereference an iterator. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.operator_eq_ [*operator=]]] - [Assignment operator. - [hr] - Move-assignment operator. ] - ] - -] - -[heading Protected Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver_iterator.dereference [*dereference]]] - [] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.equal [*equal]]] - [] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.increment [*increment]]] - [] - ] - -] - -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver_iterator.index_ [*index_]]] - [] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.values_ [*values_]]] - [] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]] - [Test two iterators for inequality. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]] - [Test two iterators for equality. ] - ] - -] - -The [link asio.reference.ip__basic_resolver_iterator `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 - - - - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - [heading Requirements] @@ -126228,46 +126067,13 @@ Get the maximum number of entries permitted in a results range. -[section:operator__star_ ip::basic_resolver_results::operator *] - - -['Inherited from ip::basic_resolver.] - -[indexterm2 asio.indexterm.ip__basic_resolver_results.operator__star_..operator *..ip::basic_resolver_results] -Dereference an iterator. - - - const basic_resolver_entry< InternetProtocol > & operator *() const; - - - -[endsect] - - [section:operator_not__eq_ ip::basic_resolver_results::operator!=] [indexterm2 asio.indexterm.ip__basic_resolver_results.operator_not__eq_..operator!=..ip::basic_resolver_results] Test two iterators for inequality. - friend bool ``[link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload1 operator!=]``( - const basic_resolver_results & a, - const basic_resolver_results & b); - `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload1 more...]]`` - - friend bool ``[link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload2 operator!=]``( - const basic_resolver_iterator & a, - const basic_resolver_iterator & b); - `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload2 more...]]`` - - -[section:overload1 ip::basic_resolver_results::operator!= (1 of 2 overloads)] - - -Test two iterators for inequality. - - - friend bool operator!=( + bool operator!=( const basic_resolver_results & a, const basic_resolver_results & b); @@ -126283,32 +126089,22 @@ Test two iterators for inequality. -[section:overload2 ip::basic_resolver_results::operator!= (2 of 2 overloads)] +[section:operator_star_ ip::basic_resolver_results::operator*] ['Inherited from ip::basic_resolver.] +[indexterm2 asio.indexterm.ip__basic_resolver_results.operator_star_..operator*..ip::basic_resolver_results] +Dereference an iterator. -Test two iterators for inequality. - - - friend bool operator!=( - const basic_resolver_iterator & a, - const basic_resolver_iterator & b); - - -[heading Requirements] -['Header: ][^asio/ip/basic_resolver_results.hpp] + const basic_resolver_entry< InternetProtocol > & operator*() const; -['Convenience header: ][^asio.hpp] [endsect] -[endsect] - [section:operator_plus__plus_ ip::basic_resolver_results::operator++] [indexterm2 asio.indexterm.ip__basic_resolver_results.operator_plus__plus_..operator++..ip::basic_resolver_results] @@ -126430,30 +126226,14 @@ Move-assignment operator. [endsect] + [section:operator_eq__eq_ ip::basic_resolver_results::operator==] [indexterm2 asio.indexterm.ip__basic_resolver_results.operator_eq__eq_..operator==..ip::basic_resolver_results] Test two iterators for equality. - friend bool ``[link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload1 operator==]``( - const basic_resolver_results & a, - const basic_resolver_results & b); - `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload1 more...]]`` - - friend bool ``[link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload2 operator==]``( - const basic_resolver_iterator & a, - const basic_resolver_iterator & b); - `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload2 more...]]`` - - -[section:overload1 ip::basic_resolver_results::operator== (1 of 2 overloads)] - - -Test two iterators for equality. - - - friend bool operator==( + bool operator==( const basic_resolver_results & a, const basic_resolver_results & b); @@ -126469,33 +126249,6 @@ Test two iterators for equality. -[section:overload2 ip::basic_resolver_results::operator== (2 of 2 overloads)] - - -['Inherited from ip::basic_resolver.] - - -Test two iterators for equality. - - - friend bool operator==( - const basic_resolver_iterator & a, - const basic_resolver_iterator & b); - - -[heading Requirements] - -['Header: ][^asio/ip/basic_resolver_results.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - -[endsect] - - [section:pointer ip::basic_resolver_results::pointer] @@ -126550,70 +126303,6 @@ The type of a non-const reference to a value in the range. typedef value_type & reference; -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]] - [The endpoint type associated with the endpoint entry. ] - - ] - - [ - - [[link asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]] - [The protocol type associated with the endpoint entry. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]] [constructor]] - [Default constructor. - [hr] - Construct with specified endpoint, host name and service name. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]] - [Get the endpoint associated with the entry. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.host_name [*host_name]]] - [Get the host name associated with the entry. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]] - [Convert to the endpoint associated with the entry. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_entry.service_name [*service_name]]] - [Get the service name associated with the entry. ] - ] - -] - -The [link asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - [heading Requirements] @@ -127117,7 +126806,7 @@ Obtain an identifier for the protocol family. Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const icmp & p1, const icmp & p2); @@ -127139,7 +126828,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const icmp & p1, const icmp & p2); @@ -127847,10 +127536,10 @@ Implements the IPPROTO\_IP/IP\_MULTICAST\_LOOP socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::ip::multicast::enable_loopback option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::ip::multicast::enable_loopback option(true); + socket.set_option(option); @@ -127858,11 +127547,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::ip::multicast::enable_loopback option; + socket.get_option(option); + bool is_set = option.value(); @@ -127899,10 +127588,10 @@ Implements the IPPROTO\_IP/IP\_MULTICAST\_TTL socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::ip::multicast::hops option(4); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::ip::multicast::hops option(4); + socket.set_option(option); @@ -127910,11 +127599,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::ip::multicast::hops option; + socket.get_option(option); + int ttl = option.value(); @@ -127951,12 +127640,12 @@ Implements the IPPROTO\_IP/IP\_ADD\_MEMBERSHIP socket option. 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); + 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); @@ -127993,12 +127682,12 @@ Implements the IPPROTO\_IP/IP\_DROP\_MEMBERSHIP socket option. 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); + 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); @@ -128035,12 +127724,12 @@ Implements the IPPROTO\_IP/IP\_MULTICAST\_IF socket option. 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); + 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); @@ -128121,12 +127810,16 @@ Represents an IPv4 network. [hr] Construct network based on the specified address and netmask. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ [[link asio.reference.ip__network_v4.operator_eq_ [*operator=]]] - [Assign from another network. ] + [Assign from another network. + [hr] + Move-assign from another network. ] ] [ @@ -128462,7 +128155,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__network_v4.network_v4.overload4 more...]]`` -[section:overload1 ip::network_v4::network_v4 (1 of 4 overloads)] +Move constructor. + + + ``[link asio.reference.ip__network_v4.network_v4.overload5 network_v4]``( + network_v4 && other); + `` [''''»''' [link asio.reference.ip__network_v4.network_v4.overload5 more...]]`` + + +[section:overload1 ip::network_v4::network_v4 (1 of 5 overloads)] Default constructor. @@ -128476,7 +128177,7 @@ Default constructor. -[section:overload2 ip::network_v4::network_v4 (2 of 4 overloads)] +[section:overload2 ip::network_v4::network_v4 (2 of 5 overloads)] Construct a network based on the specified address and prefix length. @@ -128492,7 +128193,7 @@ Construct a network based on the specified address and prefix length. -[section:overload3 ip::network_v4::network_v4 (3 of 4 overloads)] +[section:overload3 ip::network_v4::network_v4 (3 of 5 overloads)] Construct network based on the specified address and netmask. @@ -128508,7 +128209,7 @@ Construct network based on the specified address and netmask. -[section:overload4 ip::network_v4::network_v4 (4 of 4 overloads)] +[section:overload4 ip::network_v4::network_v4 (4 of 5 overloads)] Copy constructor. @@ -128519,6 +128220,21 @@ Copy constructor. +[endsect] + + + +[section:overload5 ip::network_v4::network_v4 (5 of 5 overloads)] + + +Move constructor. + + + network_v4( + network_v4 && other); + + + [endsect] @@ -128531,7 +128247,7 @@ Copy constructor. Compare two networks for inequality. - friend bool operator!=( + bool operator!=( const network_v4 & a, const network_v4 & b); @@ -128546,10 +128262,28 @@ Compare two networks for inequality. [endsect] - [section:operator_eq_ ip::network_v4::operator=] [indexterm2 asio.indexterm.ip__network_v4.operator_eq_..operator=..ip::network_v4] +Assign from another network. + + + network_v4 & ``[link asio.reference.ip__network_v4.operator_eq_.overload1 operator=]``( + const network_v4 & other); + `` [''''»''' [link asio.reference.ip__network_v4.operator_eq_.overload1 more...]]`` + + +Move-assign from another network. + + + network_v4 & ``[link asio.reference.ip__network_v4.operator_eq_.overload2 operator=]``( + network_v4 && other); + `` [''''»''' [link asio.reference.ip__network_v4.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::network_v4::operator= (1 of 2 overloads)] + + Assign from another network. @@ -128562,13 +128296,30 @@ Assign from another network. +[section:overload2 ip::network_v4::operator= (2 of 2 overloads)] + + +Move-assign from another network. + + + network_v4 & operator=( + network_v4 && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::network_v4::operator==] [indexterm2 asio.indexterm.ip__network_v4.operator_eq__eq_..operator==..ip::network_v4] Compare two networks for equality. - friend bool operator==( + bool operator==( const network_v4 & a, const network_v4 & b); @@ -128695,12 +128446,16 @@ Represents an IPv6 network. [hr] Construct a network based on the specified address and prefix length. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ [[link asio.reference.ip__network_v6.operator_eq_ [*operator=]]] - [Assign from another network. ] + [Assign from another network. + [hr] + Move-assign from another network. ] ] [ @@ -128999,7 +128754,15 @@ Copy constructor. `` [''''»''' [link asio.reference.ip__network_v6.network_v6.overload3 more...]]`` -[section:overload1 ip::network_v6::network_v6 (1 of 3 overloads)] +Move constructor. + + + ``[link asio.reference.ip__network_v6.network_v6.overload4 network_v6]``( + network_v6 && other); + `` [''''»''' [link asio.reference.ip__network_v6.network_v6.overload4 more...]]`` + + +[section:overload1 ip::network_v6::network_v6 (1 of 4 overloads)] Default constructor. @@ -129013,7 +128776,7 @@ Default constructor. -[section:overload2 ip::network_v6::network_v6 (2 of 3 overloads)] +[section:overload2 ip::network_v6::network_v6 (2 of 4 overloads)] Construct a network based on the specified address and prefix length. @@ -129029,7 +128792,7 @@ Construct a network based on the specified address and prefix length. -[section:overload3 ip::network_v6::network_v6 (3 of 3 overloads)] +[section:overload3 ip::network_v6::network_v6 (3 of 4 overloads)] Copy constructor. @@ -129040,6 +128803,21 @@ Copy constructor. +[endsect] + + + +[section:overload4 ip::network_v6::network_v6 (4 of 4 overloads)] + + +Move constructor. + + + network_v6( + network_v6 && other); + + + [endsect] @@ -129052,7 +128830,7 @@ Copy constructor. Compare two networks for inequality. - friend bool operator!=( + bool operator!=( const network_v6 & a, const network_v6 & b); @@ -129067,10 +128845,28 @@ Compare two networks for inequality. [endsect] - [section:operator_eq_ ip::network_v6::operator=] [indexterm2 asio.indexterm.ip__network_v6.operator_eq_..operator=..ip::network_v6] +Assign from another network. + + + network_v6 & ``[link asio.reference.ip__network_v6.operator_eq_.overload1 operator=]``( + const network_v6 & other); + `` [''''»''' [link asio.reference.ip__network_v6.operator_eq_.overload1 more...]]`` + + +Move-assign from another network. + + + network_v6 & ``[link asio.reference.ip__network_v6.operator_eq_.overload2 operator=]``( + network_v6 && other); + `` [''''»''' [link asio.reference.ip__network_v6.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::network_v6::operator= (1 of 2 overloads)] + + Assign from another network. @@ -129083,13 +128879,30 @@ Assign from another network. +[section:overload2 ip::network_v6::operator= (2 of 2 overloads)] + + +Move-assign from another network. + + + network_v6 & operator=( + network_v6 && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::network_v6::operator==] [indexterm2 asio.indexterm.ip__network_v6.operator_eq__eq_..operator==..ip::network_v6] Compare two networks for equality. - friend bool operator==( + bool operator==( const network_v6 & a, const network_v6 & b); @@ -130148,12 +129961,12 @@ Synchronous `accept` operations are thread safe, if the underlying operating sys 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(); + 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(); @@ -130515,10 +130328,10 @@ Implements the IPPROTO\_TCP/TCP\_NODELAY socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::tcp::no_delay option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option(true); + socket.set_option(option); @@ -130526,11 +130339,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::tcp::no_delay option; + socket.get_option(option); + bool is_set = option.value(); @@ -130555,7 +130368,7 @@ Getting the current option value: Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const tcp & p1, const tcp & p2); @@ -130577,7 +130390,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const tcp & p1, const tcp & p2); @@ -131560,7 +131373,7 @@ Obtain an identifier for the protocol family. Compare two protocols for inequality. - friend bool operator!=( + bool operator!=( const udp & p1, const udp & p2); @@ -131582,7 +131395,7 @@ Compare two protocols for inequality. Compare two protocols for equality. - friend bool operator==( + bool operator==( const udp & p1, const udp & p2); @@ -132290,10 +132103,10 @@ Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::ip::unicast::hops option(4); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::ip::unicast::hops option(4); + socket.set_option(option); @@ -132301,11 +132114,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::ip::unicast::hops option; + socket.get_option(option); + int ttl = option.value(); @@ -132374,10 +132187,10 @@ Implements the IPPROTO\_IPV6/IPV6\_V6ONLY socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::ip::v6_only option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::v6_only option(true); + socket.set_option(option); @@ -132385,11 +132198,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::ip::v6_only option; + socket.get_option(option); + bool v6_only = option.value(); @@ -132416,7 +132229,7 @@ Getting the current option value: template< typename T, typename Property, - typename = void> + = void> struct is_applicable_property @@ -132440,7 +132253,8 @@ The [link asio.reference.is_async_operation `is_async_operation`] trait detects template< typename T, typename... Args> - struct is_async_operation + struct is_async_operation : + public integral_constant< bool, automatically_determined > Class template `is_async_operation` is a trait is derived from `true_type` if the expression `T(Args..., token)` initiates an asynchronous operation, where `token` is an unspecified completion token type. Otherwise, `is_async_operation` is derived from `false_type`. @@ -132464,7 +132278,8 @@ Trait to determine whether a type satisfies the ConstBufferSequence requirements template< typename T> - struct is_const_buffer_sequence + struct is_const_buffer_sequence : + public integral_constant< bool, automatically_determined > [heading Requirements] @@ -132486,7 +132301,8 @@ The [link asio.reference.is_contiguous_iterator `is_contiguous_iterator`] class template< typename T> - struct is_contiguous_iterator + struct is_contiguous_iterator : + public integral_constant< bool, std::contiguous_iterator< T > > [heading Requirements] @@ -132531,7 +132347,8 @@ Trait to determine whether a type satisfies the DynamicBuffer requirements. template< typename T> - struct is_dynamic_buffer + struct is_dynamic_buffer : + public integral_constant< bool, automatically_determined > 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. @@ -132555,7 +132372,8 @@ Trait to determine whether a type satisfies the DynamicBuffer\_v1 requirements. template< typename T> - struct is_dynamic_buffer_v1 + struct is_dynamic_buffer_v1 : + public integral_constant< bool, automatically_determined > [heading Requirements] @@ -132577,7 +132395,8 @@ Trait to determine whether a type satisfies the DynamicBuffer\_v2 requirements. template< typename T> - struct is_dynamic_buffer_v2 + struct is_dynamic_buffer_v2 : + public integral_constant< bool, automatically_determined > [heading Requirements] @@ -132646,7 +132465,8 @@ The [link asio.reference.is_executor `is_executor`] trait detects whether a type template< typename T> - struct is_executor + struct is_executor : + public integral_constant< bool, automatically_determined > 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`. @@ -132717,7 +132537,8 @@ Trait to determine whether a type satisfies the MutableBufferSequence requiremen template< typename T> - struct is_mutable_buffer_sequence + struct is_mutable_buffer_sequence : + public integral_constant< bool, automatically_determined > [heading Requirements] @@ -132740,7 +132561,8 @@ A type trait that determines whether a `prefer` expression will not throw. template< typename T, typename... Properties> - struct is_nothrow_prefer + struct is_nothrow_prefer : + public integral_constant< bool, automatically_determined > Class template `is_nothrow_prefer` is a trait that is derived from `true_type` if the expression `asio::prefer(std::declval(), std::declval()...)` is `noexcept`; otherwise `false_type`. @@ -132765,7 +132587,8 @@ A type trait that determines whether a `query` expression will not throw. template< typename T, typename Property> - struct is_nothrow_query + struct is_nothrow_query : + public integral_constant< bool, automatically_determined > Class template `is_nothrow_query` is a trait that is derived from `true_type` if the expression `asio::query(std::declval(), std::declval())` is `noexcept`; otherwise `false_type`. @@ -132790,7 +132613,8 @@ A type trait that determines whether a `require` expression will not throw. template< typename T, typename... Properties> - struct is_nothrow_require + struct is_nothrow_require : + public integral_constant< bool, automatically_determined > Class template `is_nothrow_require` is a trait that is derived from `true_type` if the expression `asio::require(std::declval(), std::declval()...)` is `noexcept`; otherwise `false_type`. @@ -132815,7 +132639,8 @@ A type trait that determines whether a `require_concept` expression will not thr template< typename T, typename Property> - struct is_nothrow_require_concept + struct is_nothrow_require_concept : + public integral_constant< bool, automatically_determined > Class template `is_nothrow_require_concept` is a trait that is derived from `true_type` if the expression `asio::require_concept(std::declval(), std::declval())` is `noexcept`; otherwise `false_type`. @@ -132966,7 +132791,9 @@ Describes an endpoint for a UNIX socket. [hr] Construct an endpoint using the specified path name. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -132981,7 +132808,9 @@ Describes an endpoint for a UNIX socket. [ [[link asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -133103,7 +132932,15 @@ Copy constructor. `` [''''»''' [link asio.reference.local__basic_endpoint.basic_endpoint.overload4 more...]]`` -[section:overload1 local::basic_endpoint::basic_endpoint (1 of 4 overloads)] +Move constructor. + + + ``[link asio.reference.local__basic_endpoint.basic_endpoint.overload5 basic_endpoint]``( + basic_endpoint && other); + `` [''''»''' [link asio.reference.local__basic_endpoint.basic_endpoint.overload5 more...]]`` + + +[section:overload1 local::basic_endpoint::basic_endpoint (1 of 5 overloads)] Default constructor. @@ -133117,7 +132954,7 @@ Default constructor. -[section:overload2 local::basic_endpoint::basic_endpoint (2 of 4 overloads)] +[section:overload2 local::basic_endpoint::basic_endpoint (2 of 5 overloads)] Construct an endpoint using the specified path name. @@ -133132,7 +132969,7 @@ Construct an endpoint using the specified path name. -[section:overload3 local::basic_endpoint::basic_endpoint (3 of 4 overloads)] +[section:overload3 local::basic_endpoint::basic_endpoint (3 of 5 overloads)] Construct an endpoint using the specified path name. @@ -133147,7 +132984,7 @@ Construct an endpoint using the specified path name. -[section:overload4 local::basic_endpoint::basic_endpoint (4 of 4 overloads)] +[section:overload4 local::basic_endpoint::basic_endpoint (4 of 5 overloads)] Copy constructor. @@ -133158,6 +132995,21 @@ Copy constructor. +[endsect] + + + +[section:overload5 local::basic_endpoint::basic_endpoint (5 of 5 overloads)] + + +Move constructor. + + + basic_endpoint( + basic_endpoint && other); + + + [endsect] @@ -133247,7 +133099,7 @@ The type of the endpoint structure. This type is dependent on the underlying imp Compare two endpoints for inequality. - friend bool operator!=( + bool operator!=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -133269,7 +133121,7 @@ Compare two endpoints for inequality. Compare endpoints for ordering. - friend bool operator<( + bool operator<( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -133291,6 +133143,10 @@ Compare endpoints for ordering. Output an endpoint as a string. + template< + typename Elem, + typename Traits, + typename ``[link asio.reference.Protocol Protocol]``> std::basic_ostream< Elem, Traits > & operator<<( std::basic_ostream< Elem, Traits > & os, const basic_endpoint< Protocol > & endpoint); @@ -133328,7 +133184,7 @@ The output stream. Compare endpoints for ordering. - friend bool operator<=( + bool operator<=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -133343,10 +133199,28 @@ Compare endpoints for ordering. [endsect] - [section:operator_eq_ local::basic_endpoint::operator=] [indexterm2 asio.indexterm.local__basic_endpoint.operator_eq_..operator=..local::basic_endpoint] +Assign from another endpoint. + + + basic_endpoint & ``[link asio.reference.local__basic_endpoint.operator_eq_.overload1 operator=]``( + const basic_endpoint & other); + `` [''''»''' [link asio.reference.local__basic_endpoint.operator_eq_.overload1 more...]]`` + + +Move-assign from another endpoint. + + + basic_endpoint & ``[link asio.reference.local__basic_endpoint.operator_eq_.overload2 operator=]``( + basic_endpoint && other); + `` [''''»''' [link asio.reference.local__basic_endpoint.operator_eq_.overload2 more...]]`` + + +[section:overload1 local::basic_endpoint::operator= (1 of 2 overloads)] + + Assign from another endpoint. @@ -133359,13 +133233,30 @@ Assign from another endpoint. +[section:overload2 local::basic_endpoint::operator= (2 of 2 overloads)] + + +Move-assign from another endpoint. + + + basic_endpoint & operator=( + basic_endpoint && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ local::basic_endpoint::operator==] [indexterm2 asio.indexterm.local__basic_endpoint.operator_eq__eq_..operator==..local::basic_endpoint] Compare two endpoints for equality. - friend bool operator==( + bool operator==( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -133387,7 +133278,7 @@ Compare two endpoints for equality. Compare endpoints for ordering. - friend bool operator>( + bool operator>( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -133409,7 +133300,7 @@ Compare endpoints for ordering. Compare endpoints for ordering. - friend bool operator>=( + bool operator>=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2); @@ -133742,7 +133633,9 @@ The type of a UNIX domain endpoint. [hr] Construct an endpoint using the specified path name. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -133757,7 +133650,9 @@ The type of a UNIX domain endpoint. [ [[link asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -134757,12 +134652,12 @@ Synchronous `accept` operations are thread safe, if the underlying operating sys 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(); + 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(); @@ -134820,7 +134715,9 @@ The type of a UNIX domain endpoint. [hr] Construct an endpoint using the specified path name. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -134835,7 +134732,9 @@ The type of a UNIX domain endpoint. [ [[link asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -135824,12 +135723,12 @@ Synchronous `accept` operations are thread safe, if the underlying operating sys 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(); + 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(); @@ -135887,7 +135786,9 @@ The type of a UNIX domain endpoint. [hr] Construct an endpoint using the specified path name. [hr] - Copy constructor. ] + Copy constructor. + [hr] + Move constructor. ] ] [ @@ -135902,7 +135803,9 @@ The type of a UNIX domain endpoint. [ [[link asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + [hr] + Move-assign from another endpoint. ] ] [ @@ -136627,7 +136530,7 @@ Obtain an identifier for the type of the protocol. [indexterm1 asio.indexterm.make_strand..make_strand] -The `asio::make_strand` function creates a [link asio.reference.strand `strand`] object for an executor or execution context. +The [link asio.reference.make_strand `make_strand`] function creates a [link asio.reference.strand `strand`] object for an executor or execution context. Create a [link asio.reference.strand `strand`] object for an executor. @@ -136636,7 +136539,7 @@ Create a [link asio.reference.strand `strand`] object for an executor. typename ``[link asio.reference.Executor1 Executor]``> strand< Executor > ``[link asio.reference.make_strand.overload1 make_strand]``( const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.make_strand.overload1 more...]]`` Create a [link asio.reference.strand `strand`] object for an execution context. @@ -136645,7 +136548,7 @@ Create a [link asio.reference.strand `strand`] object for an execution context. typename ExecutionContext> strand< typename ExecutionContext::executor_type > ``[link asio.reference.make_strand.overload2 make_strand]``( ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.make_strand.overload2 more...]]`` [heading Requirements] @@ -136665,7 +136568,7 @@ Create a [link asio.reference.strand `strand`] object for an executor. typename ``[link asio.reference.Executor1 Executor]``> strand< Executor > make_strand( const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -136700,7 +136603,7 @@ Create a [link asio.reference.strand `strand`] object for an execution context. typename ExecutionContext> strand< typename ExecutionContext::executor_type > make_strand( ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -136736,41 +136639,41 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object typename ``[link asio.reference.Executor1 Executor]``> executor_work_guard< Executor > ``[link asio.reference.make_work_guard.overload1 make_work_guard]``( const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.make_work_guard.overload1 more...]]`` template< typename ExecutionContext> executor_work_guard< typename ExecutionContext::executor_type > ``[link asio.reference.make_work_guard.overload2 make_work_guard]``( ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.make_work_guard.overload2 more...]]`` template< typename T> - executor_work_guard< typename constraint< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value, associated_executor< T > >::type::type > ``[link asio.reference.make_work_guard.overload3 make_work_guard]``( + executor_work_guard< typename constraint_t< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value, associated_executor< T > >::type > ``[link asio.reference.make_work_guard.overload3 make_work_guard]``( const T & t); `` [''''»''' [link asio.reference.make_work_guard.overload3 more...]]`` template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - executor_work_guard< typename associated_executor< T, Executor >::type > ``[link asio.reference.make_work_guard.overload4 make_work_guard]``( + executor_work_guard< associated_executor_t< T, Executor > > ``[link asio.reference.make_work_guard.overload4 make_work_guard]``( const T & t, const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.make_work_guard.overload4 more...]]`` template< typename T, typename ExecutionContext> - executor_work_guard< typename associated_executor< T, typename ExecutionContext::executor_type >::type > ``[link asio.reference.make_work_guard.overload5 make_work_guard]``( + executor_work_guard< associated_executor_t< T, typename ExecutionContext::executor_type > > ``[link asio.reference.make_work_guard.overload5 make_work_guard]``( const T & t, ExecutionContext & ctx, - typename constraint< !is_executor< T >::value >::type = 0, - typename constraint< !execution::is_executor< T >::value >::type = 0, - typename constraint< !is_convertible< T &, execution_context & >::value >::type = 0, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< !is_executor< T >::value > = 0, + constraint_t< !execution::is_executor< T >::value > = 0, + constraint_t< !is_convertible< T &, execution_context & >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.make_work_guard.overload5 more...]]`` [heading Requirements] @@ -136790,7 +136693,7 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object typename ``[link asio.reference.Executor1 Executor]``> executor_work_guard< Executor > make_work_guard( const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -136825,7 +136728,7 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object typename ExecutionContext> executor_work_guard< typename ExecutionContext::executor_type > make_work_guard( ExecutionContext & ctx, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -136858,7 +136761,7 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object template< typename T> - executor_work_guard< typename constraint< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value, associated_executor< T > >::type::type > make_work_guard( + executor_work_guard< typename constraint_t< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value, associated_executor< T > >::type > make_work_guard( const T & t); @@ -136893,10 +136796,10 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - executor_work_guard< typename associated_executor< T, Executor >::type > make_work_guard( + executor_work_guard< associated_executor_t< T, Executor > > make_work_guard( const T & t, const Executor & ex, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -136914,7 +136817,8 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object [heading Return Value] -A work guard constructed with the associated executor of the object `t`, which is obtained as if by calling `get_associated_executor(t, ex)`. +A work guard constructed with the associated executor of the object `t`, which is obtained as if by calling `get_associated_executor(t, +ex)`. @@ -136932,13 +136836,13 @@ Create an [link asio.reference.executor_work_guard `executor_work_guard`] object template< typename T, typename ExecutionContext> - executor_work_guard< typename associated_executor< T, typename ExecutionContext::executor_type >::type > make_work_guard( + executor_work_guard< associated_executor_t< T, typename ExecutionContext::executor_type > > make_work_guard( const T & t, ExecutionContext & ctx, - typename constraint< !is_executor< T >::value >::type = 0, - typename constraint< !execution::is_executor< T >::value >::type = 0, - typename constraint< !is_convertible< T &, execution_context & >::value >::type = 0, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< !is_executor< T >::value > = 0, + constraint_t< !execution::is_executor< T >::value > = 0, + constraint_t< !is_convertible< T &, execution_context & >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -136975,7 +136879,7 @@ Exception thrown when there are multiple pending exceptions to rethrow. class multiple_exceptions : - public std::exception + public exception [heading Member Functions] @@ -137113,8 +137017,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::mutable_buffer b1 = ...; - std::size_t s1 = b1.size(); - unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + unsigned char* p1 = static_cast(b1.data()); @@ -137630,8 +137534,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::mutable_buffer b1 = ...; - std::size_t s1 = b1.size(); - unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + unsigned char* p1 = static_cast(b1.data()); @@ -138039,8 +137943,8 @@ The contents of a buffer may be accessed using the `data()` and `size()` member asio::mutable_buffer b1 = ...; - std::size_t s1 = b1.size(); - unsigned char* p1 = static_cast(b1.data()); + std::size_t s1 = b1.size(); + unsigned char* p1 = static_cast(b1.data()); @@ -138062,32 +137966,6 @@ The `data()` member function permits violations of type safety, so uses of it in [endsect] -[section:operator_lt__lt_ operator<<] - -[indexterm1 asio.indexterm.operator_lt__lt_..operator<<] - -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); - - -[heading Requirements] - -['Header: ][^asio/error_code.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_pipe_ operator|] [indexterm1 asio.indexterm.operator_pipe_..operator|] @@ -138100,7 +137978,7 @@ Pipe operator used to chain deferred operations. typename Tail> auto operator|( Head head, - Tail && tail) const; + Tail && tail); [heading Requirements] @@ -138118,7 +137996,7 @@ Pipe operator used to chain deferred operations. [indexterm1 asio.indexterm.placeholders__bytes_transferred..placeholders::bytes_transferred] -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`. +An argument placeholder, for use with std::bind() or 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 [link asio.reference.async_write `async_write`]. unspecified bytes_transferred; @@ -138139,7 +138017,7 @@ An argument placeholder, for use with boost::bind(), that corresponds to the byt [indexterm1 asio.indexterm.placeholders__endpoint..placeholders::endpoint] -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`. +An argument placeholder, for use with std::bind() or boost::bind(), that corresponds to the results argument of a handler for asynchronous functions such as [link asio.reference.async_connect `async_connect`]. unspecified endpoint; @@ -138160,7 +138038,7 @@ An argument placeholder, for use with boost::bind(), that corresponds to the res [indexterm1 asio.indexterm.placeholders__error..placeholders::error] -An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions. +An argument placeholder, for use with std::bind() or boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions. unspecified error; @@ -138181,7 +138059,7 @@ An argument placeholder, for use with boost::bind(), that corresponds to the err [indexterm1 asio.indexterm.placeholders__iterator..placeholders::iterator] -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`. +An argument placeholder, for use with std::bind() or boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as [link asio.reference.async_connect `async_connect`]. unspecified iterator; @@ -138202,7 +138080,7 @@ An argument placeholder, for use with boost::bind(), that corresponds to the ite [indexterm1 asio.indexterm.placeholders__results..placeholders::results] -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. +An argument placeholder, for use with std::bind() or boost::bind(), that corresponds to the results argument of a handler for asynchronous functions such as asio::basic\_resolver::async\_resolve. unspecified results; @@ -138223,7 +138101,7 @@ An argument placeholder, for use with boost::bind(), that corresponds to the res [indexterm1 asio.indexterm.placeholders__signal_number..placeholders::signal_number] -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`. +An argument placeholder, for use with std::bind() or 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; @@ -138480,10 +138358,10 @@ Asynchronously wait for the descriptor to become ready to read, ready to write, template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a descriptor to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -138499,8 +138377,8 @@ This function is used to perform an asynchronous wait for a descriptor to enter [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -138511,7 +138389,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -138521,21 +138399,21 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::posix::stream_descriptor descriptor(my_context); + ... + descriptor.async_wait( + asio::posix::stream_descriptor::wait_read, + wait_handler); @@ -138574,7 +138452,7 @@ Construct a descriptor without opening it. typename ExecutionContext> explicit ``[link asio.reference.posix__basic_descriptor.basic_descriptor.overload2 basic_descriptor]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.posix__basic_descriptor.basic_descriptor.overload2 more...]]`` @@ -138591,7 +138469,7 @@ Construct a descriptor on an existing native descriptor. ``[link asio.reference.posix__basic_descriptor.basic_descriptor.overload4 basic_descriptor]``( ExecutionContext & context, const native_handle_type & native_descriptor, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.posix__basic_descriptor.basic_descriptor.overload4 more...]]`` @@ -138610,7 +138488,7 @@ Move-construct a [link asio.reference.posix__basic_descriptor `posix::basic_desc typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.posix__basic_descriptor.basic_descriptor.overload6 basic_descriptor]``( basic_descriptor< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.posix__basic_descriptor.basic_descriptor.overload6 more...]]`` @@ -138653,7 +138531,7 @@ Construct a descriptor without opening it. typename ExecutionContext> basic_descriptor( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a descriptor without opening it. @@ -138728,7 +138606,7 @@ Construct a descriptor on an existing native descriptor. basic_descriptor( ExecutionContext & context, const native_handle_type & native_descriptor, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a descriptor object to hold an existing native descriptor. @@ -138806,7 +138684,7 @@ Move-construct a [link asio.reference.posix__basic_descriptor `posix::basic_desc typename ``[link asio.reference.Executor1 Executor1]``> basic_descriptor( basic_descriptor< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a descriptor from one object to another. @@ -138855,11 +138733,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -139116,11 +138994,11 @@ This function is used to execute an IO control command on the descriptor. 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(); + 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(); @@ -139165,16 +139043,16 @@ This function is used to execute an IO control command on the descriptor. 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(); + 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(); @@ -139754,7 +139632,7 @@ Move-assign a [link asio.reference.posix__basic_descriptor `posix::basic_descrip template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_descriptor & >::type ``[link asio.reference.posix__basic_descriptor.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_descriptor & > ``[link asio.reference.posix__basic_descriptor.operator_eq_.overload2 operator=]``( basic_descriptor< Executor1 > && other); `` [''''»''' [link asio.reference.posix__basic_descriptor.operator_eq_.overload2 more...]]`` @@ -139801,7 +139679,7 @@ Move-assign a [link asio.reference.posix__basic_descriptor `posix::basic_descrip template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_descriptor & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_descriptor & > operator=( basic_descriptor< Executor1 > && other); @@ -139891,9 +139769,9 @@ This function is used to perform a blocking wait for a descriptor to enter a rea Waiting for a descriptor to become readable. - asio::posix::stream_descriptor descriptor(my_context); - ... - descriptor.wait(asio::posix::stream_descriptor::wait_read); + asio::posix::stream_descriptor descriptor(my_context); + ... + descriptor.wait(asio::posix::stream_descriptor::wait_read); @@ -139935,10 +139813,10 @@ This function is used to perform a blocking wait for a descriptor to enter a rea 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); + asio::posix::stream_descriptor descriptor(my_context); + ... + asio::error_code ec; + descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); @@ -140244,7 +140122,7 @@ Provides stream-oriented descriptor functionality. template< typename ``[link asio.reference.Executor1 Executor]`` = any_io_executor> class basic_stream_descriptor : - public posix::basic_descriptor< Executor > + public posix::basic_descriptor< any_io_executor > [heading Types] @@ -140493,10 +140371,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the stream descriptor. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -140512,9 +140390,9 @@ This function is used to asynchronously read data from the stream descriptor. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -140525,7 +140403,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -140540,7 +140418,7 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - descriptor.async_read_some(asio::buffer(data, size), handler); + descriptor.async_read_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -140576,10 +140454,10 @@ Asynchronously wait for the descriptor to become ready to read, ready to write, template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( wait_type w, - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WaitToken && token = default_completion_token_t< executor_type >()); This function is used to perform an asynchronous wait for a descriptor to enter a ready to read, write or error condition state. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -140595,8 +140473,8 @@ This function is used to perform an asynchronous wait for a descriptor to enter [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -140607,7 +140485,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -140617,21 +140495,21 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void wait_handler(const asio::error_code& error) - { - if (!error) - { - // Wait succeeded. - } - } + 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); + asio::posix::stream_descriptor descriptor(my_context); + ... + descriptor.async_wait( + asio::posix::stream_descriptor::wait_read, + wait_handler); @@ -140665,10 +140543,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the stream descriptor. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -140684,9 +140562,9 @@ This function is used to asynchronously write data to the stream descriptor. It [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -140697,7 +140575,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -140712,7 +140590,7 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - descriptor.async_write_some(asio::buffer(data, size), handler); + descriptor.async_write_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -140751,7 +140629,7 @@ Construct a stream descriptor without opening it. typename ExecutionContext> explicit ``[link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 basic_stream_descriptor]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 more...]]`` @@ -140768,7 +140646,7 @@ Construct a stream descriptor on an existing native descriptor. ``[link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload4 basic_stream_descriptor]``( ExecutionContext & context, const native_handle_type & native_descriptor, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload4 more...]]`` @@ -140787,7 +140665,7 @@ Move-construct a [link asio.reference.posix__basic_stream_descriptor `posix::bas typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload6 basic_stream_descriptor]``( basic_stream_descriptor< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload6 more...]]`` @@ -140830,7 +140708,7 @@ Construct a stream descriptor without opening it. typename ExecutionContext> basic_stream_descriptor( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); 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. @@ -140905,7 +140783,7 @@ Construct a stream descriptor on an existing native descriptor. basic_stream_descriptor( ExecutionContext & context, const native_handle_type & native_descriptor, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a stream descriptor object to hold an existing native descriptor. @@ -140983,7 +140861,7 @@ Move-construct a [link asio.reference.posix__basic_stream_descriptor `posix::bas typename ``[link asio.reference.Executor1 Executor1]``> basic_stream_descriptor( basic_stream_descriptor< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a descriptor from one object to another. @@ -141032,11 +140910,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -141311,11 +141189,11 @@ This function is used to execute an IO control command on the descriptor. 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(); + 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(); @@ -141363,16 +141241,16 @@ This function is used to execute an IO control command on the descriptor. 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(); + 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(); @@ -142150,7 +142028,7 @@ Move-assign a [link asio.reference.posix__basic_stream_descriptor `posix::basic_ template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_stream_descriptor & >::type ``[link asio.reference.posix__basic_stream_descriptor.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_stream_descriptor & > ``[link asio.reference.posix__basic_stream_descriptor.operator_eq_.overload2 operator=]``( basic_stream_descriptor< Executor1 > && other); `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.operator_eq_.overload2 more...]]`` @@ -142197,7 +142075,7 @@ Move-assign a [link asio.reference.posix__basic_stream_descriptor `posix::basic_ template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_stream_descriptor & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_stream_descriptor & > operator=( basic_stream_descriptor< Executor1 > && other); @@ -142295,7 +142173,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - descriptor.read_some(asio::buffer(data, size)); + descriptor.read_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -142419,9 +142297,9 @@ This function is used to perform a blocking wait for a descriptor to enter a rea Waiting for a descriptor to become readable. - asio::posix::stream_descriptor descriptor(my_context); - ... - descriptor.wait(asio::posix::stream_descriptor::wait_read); + asio::posix::stream_descriptor descriptor(my_context); + ... + descriptor.wait(asio::posix::stream_descriptor::wait_read); @@ -142466,10 +142344,10 @@ This function is used to perform a blocking wait for a descriptor to enter a rea 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); + asio::posix::stream_descriptor descriptor(my_context); + ... + asio::error_code ec; + descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); @@ -142593,7 +142471,7 @@ The write\_some operation may not transmit all of the data to the peer. Consider To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - descriptor.write_some(asio::buffer(data, size)); + descriptor.write_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -143139,11 +143017,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -143424,26 +143302,26 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.NullaryToken NullaryToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.post.overload1 post]``( + auto ``[link asio.reference.post.overload1 post]``( NullaryToken && token); `` [''''»''' [link asio.reference.post.overload1 more...]]`` template< typename ``[link asio.reference.Executor1 Executor]``, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.post.overload2 post]``( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link asio.reference.post.overload2 post]``( const Executor & ex, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.post.overload2 more...]]`` template< typename ExecutionContext, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.post.overload3 post]``( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link asio.reference.post.overload3 post]``( ExecutionContext & ctx, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.post.overload3 more...]]`` [heading Requirements] @@ -143461,7 +143339,7 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.NullaryToken NullaryToken]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( + auto post( NullaryToken && token); @@ -143477,7 +143355,7 @@ The use of `post()`, rather than [link asio.reference.defer `defer`], indicates [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -143491,11 +143369,11 @@ This function returns `async_initiate(Init{}, token)`, whe class Init - { - public: - template - void operator()(CompletionHandler&& completion_handler) const; - }; + { + public: + template + void operator()(CompletionHandler&& completion_handler) const; + }; @@ -143503,9 +143381,9 @@ This function returns `async_initiate(Init{}, token)`, whe The function call operator of `Init:` -* Obtains the handler's associated executor object `ex` of type `Ex` by performing +* Obtains the handler's associated executor object `ex` of type `Ex` by performing - auto ex = get_associated_executor(handler); + auto ex = get_associated_executor(handler); @@ -143513,7 +143391,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(handler); @@ -143521,11 +143399,11 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, performs - prefer( - require(ex, execution::blocking.never), - execution::relationship.fork, - execution::allocator(alloc) - ).execute(std::forward(completion_handler)); + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::forward(completion_handler)); @@ -143533,9 +143411,9 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, performs - ex.post( - std::forward(completion_handler), - alloc); + ex.post( + std::forward(completion_handler), + alloc); @@ -143545,7 +143423,7 @@ The function call operator of `Init:` - void() + void() @@ -143565,11 +143443,11 @@ Submits a completion token or function object for execution. template< typename ``[link asio.reference.Executor1 Executor]``, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto post( const Executor & ex, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 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()`. @@ -143586,7 +143464,7 @@ The use of `post()`, rather than [link asio.reference.defer `defer`], indicates [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -143600,16 +143478,16 @@ This function returns `async_initiate(Init{ex}, token)`, w class Init - { - public: - using executor_type = Executor; - explicit Init(const Executor& ex) : ex_(ex) {} - executor_type get_executor() const noexcept { return ex_; } - template - void operator()(CompletionHandler&& completion_handler) const; - private: - Executor ex_; // exposition only - }; + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler) const; + private: + Executor ex_; // exposition only + }; @@ -143617,9 +143495,9 @@ This function returns `async_initiate(Init{ex}, token)`, w The function call operator of `Init:` -* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing - auto ex1 = get_associated_executor(handler, ex); + auto ex1 = get_associated_executor(handler, ex); @@ -143627,7 +143505,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(handler); @@ -143636,7 +143514,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, constructs a function object `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: auto a = get_associated_allocator(handler_); - prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); @@ -143645,8 +143523,8 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, constructs a function object `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: auto a = get_associated_allocator(handler_); - work_.get_executor().dispatch(std::move(handler_), a); - work_.reset(); + work_.get_executor().dispatch(std::move(handler_), a); + work_.reset(); @@ -143654,11 +143532,11 @@ The function call operator of `Init:` * If `execution::is_executor::value` is true, performs - prefer( - require(ex, execution::blocking.never), - execution::relationship.fork, - execution::allocator(alloc) - ).execute(std::move(f)); + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); @@ -143666,7 +143544,7 @@ The function call operator of `Init:` * If `execution::is_executor::value` is false, performs - ex.post(std::move(f), alloc); + ex.post(std::move(f), alloc); @@ -143676,7 +143554,7 @@ The function call operator of `Init:` - void() + void() @@ -143696,11 +143574,11 @@ Submits a completion token or function object for execution. template< typename ExecutionContext, - typename ``[link asio.reference.NullaryToken NullaryToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( + typename ``[link asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto post( ExecutionContext & ctx, - NullaryToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -143713,7 +143591,7 @@ Submits a completion token or function object for execution. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: `` - void handler(); + void handler(); `` ]] @@ -143729,7 +143607,7 @@ Submits a completion token or function object for execution. - void() + void() @@ -143864,7 +143742,7 @@ Completion token type used to specify that the completion handler arguments shou template< typename CompletionToken, typename... Values> - constexpr prepend_t< typename decay< CompletionToken >::type, typename decay< Values >::type...> prepend( + constexpr prepend_t< decay_t< CompletionToken >, decay_t< Values >... > prepend( CompletionToken && completion_token, Values &&... values); @@ -143962,7 +143840,7 @@ Constructor. [indexterm2 asio.indexterm.prepend_t.values_..values_..prepend_t] - std::tuple< Values...> values_; + std::tuple< Values... > values_; @@ -143986,7 +143864,8 @@ A customisation point that queries the value of a property. 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` and `Prop = decay_t`) is expression-equivalent to: -* If `is_applicable_property_v` is not a well-formed constant expression with value `true`, `asio::query(E, P)` is ill-formed. +* If `is_applicable_property_v` is not a well-formed constant expression with value `true`, `asio::query(E, + P)` is ill-formed. * Otherwise, `Prop::template static_query_v` if the expression `Prop::template static_query_v` is a well-formed constant expression. @@ -144317,7 +144196,7 @@ Attempt to read a certain amount of data from a stream before returning. std::size_t ``[link asio.reference.read.overload1 read]``( SyncReadStream & s, const MutableBufferSequence & buffers, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.read.overload1 more...]]`` template< @@ -144327,7 +144206,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, const MutableBufferSequence & buffers, asio::error_code & ec, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.read.overload2 more...]]`` template< @@ -144338,7 +144217,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, const MutableBufferSequence & buffers, CompletionCondition completion_condition, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.read.overload3 more...]]`` template< @@ -144350,7 +144229,7 @@ Attempt to read a certain amount of data from a stream before returning. const MutableBufferSequence & buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.read.overload4 more...]]`` template< @@ -144359,8 +144238,8 @@ Attempt to read a certain amount of data from a stream before returning. std::size_t ``[link asio.reference.read.overload5 read]``( SyncReadStream & s, DynamicBuffer_v1 && buffers, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read.overload5 more...]]`` template< @@ -144370,8 +144249,8 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v1 && buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read.overload6 more...]]`` template< @@ -144382,8 +144261,8 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read.overload7 more...]]`` template< @@ -144395,8 +144274,8 @@ Attempt to read a certain amount of data from a stream before returning. DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read.overload8 more...]]`` template< @@ -144443,7 +144322,7 @@ Attempt to read a certain amount of data from a stream before returning. std::size_t ``[link asio.reference.read.overload13 read]``( SyncReadStream & s, DynamicBuffer_v2 buffers, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read.overload13 more...]]`` template< @@ -144453,7 +144332,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v2 buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read.overload14 more...]]`` template< @@ -144464,7 +144343,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read.overload15 more...]]`` template< @@ -144476,12 +144355,12 @@ Attempt to read a certain amount of data from a stream before returning. DynamicBuffer_v2 buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read.overload16 more...]]`` [heading Requirements] -['Header: ][^asio/read.hpp] +['Header: ][^asio/impl/read.hpp] ['Convenience header: ][^asio.hpp] @@ -144498,7 +144377,7 @@ Attempt to read a certain amount of data from a stream before returning. std::size_t read( SyncReadStream & s, const MutableBufferSequence & buffers, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 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: @@ -144543,7 +144422,7 @@ The number of bytes transferred. To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::read(s, asio::buffer(data, size)); + asio::read(s, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -144553,9 +144432,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on r This overload is equivalent to calling: - asio::read( - s, buffers, - asio::transfer_all()); + asio::read( + s, buffers, + asio::transfer_all()); @@ -144580,7 +144459,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, const MutableBufferSequence & buffers, asio::error_code & ec, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 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: @@ -144617,7 +144496,7 @@ The number of bytes transferred. To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::read(s, asio::buffer(data, size), ec); + asio::read(s, asio::buffer(data, size), ec); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -144627,9 +144506,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on r This overload is equivalent to calling: - asio::read( - s, buffers, - asio::transfer_all(), ec); + asio::read( + s, buffers, + asio::transfer_all(), ec); @@ -144655,7 +144534,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, const MutableBufferSequence & buffers, CompletionCondition completion_condition, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 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: @@ -144681,12 +144560,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -144712,8 +144591,8 @@ The number of bytes transferred. To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::read(s, asio::buffer(data, size), - asio::transfer_at_least(32)); + asio::read(s, asio::buffer(data, size), + asio::transfer_at_least(32)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -144740,7 +144619,7 @@ Attempt to read a certain amount of data from a stream before returning. const MutableBufferSequence & buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type = 0); + constraint_t< is_mutable_buffer_sequence< MutableBufferSequence >::value > = 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: @@ -144766,12 +144645,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -144803,8 +144682,8 @@ Attempt to read a certain amount of data from a stream before returning. std::size_t read( SyncReadStream & s, DynamicBuffer_v1 && buffers, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -144849,9 +144728,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read( - s, buffers, - asio::transfer_all()); + asio::read( + s, buffers, + asio::transfer_all()); @@ -144876,8 +144755,8 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v1 && buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -144914,9 +144793,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read( - s, buffers, - asio::transfer_all(), ec); + asio::read( + s, buffers, + asio::transfer_all(), ec); @@ -144942,8 +144821,8 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -144969,12 +144848,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145017,8 +144896,8 @@ Attempt to read a certain amount of data from a stream before returning. DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -145044,12 +144923,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145125,9 +145004,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read( - s, b, - asio::transfer_all()); + asio::read( + s, b, + asio::transfer_all()); @@ -145188,9 +145067,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read( - s, b, - asio::transfer_all(), ec); + asio::read( + s, b, + asio::transfer_all(), ec); @@ -145241,12 +145120,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145314,12 +145193,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145351,7 +145230,7 @@ Attempt to read a certain amount of data from a stream before returning. std::size_t read( SyncReadStream & s, DynamicBuffer_v2 buffers, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -145396,9 +145275,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read( - s, buffers, - asio::transfer_all()); + asio::read( + s, buffers, + asio::transfer_all()); @@ -145423,7 +145302,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v2 buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -145460,9 +145339,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read( - s, buffers, - asio::transfer_all(), ec); + asio::read( + s, buffers, + asio::transfer_all(), ec); @@ -145488,7 +145367,7 @@ Attempt to read a certain amount of data from a stream before returning. SyncReadStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -145514,12 +145393,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145562,7 +145441,7 @@ Attempt to read a certain amount of data from a stream before returning. DynamicBuffer_v2 buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -145588,12 +145467,12 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[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, + // Result of latest read_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145709,7 +145588,7 @@ Attempt to read a certain amount of data at the specified offset before returnin [heading Requirements] -['Header: ][^asio/read_at.hpp] +['Header: ][^asio/impl/read_at.hpp] ['Convenience header: ][^asio.hpp] @@ -145773,7 +145652,7 @@ The number of bytes transferred. To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::read_at(d, 42, asio::buffer(data, size)); + asio::read_at(d, 42, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -145783,9 +145662,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on r This overload is equivalent to calling: - asio::read_at( - d, 42, buffers, - asio::transfer_all()); + asio::read_at( + d, 42, buffers, + asio::transfer_all()); @@ -145849,8 +145728,8 @@ The number of bytes transferred. To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::read_at(d, 42, - asio::buffer(data, size), ec); + asio::read_at(d, 42, + asio::buffer(data, size), ec); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -145860,9 +145739,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on r This overload is equivalent to calling: - asio::read_at( - d, 42, buffers, - asio::transfer_all(), ec); + asio::read_at( + d, 42, buffers, + asio::transfer_all(), ec); @@ -145916,12 +145795,12 @@ This operation is implemented in terms of zero or more calls to the device's rea [[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, + // Result of latest read_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -145947,8 +145826,8 @@ The number of bytes transferred. To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::read_at(d, 42, asio::buffer(data, size), - asio::transfer_at_least(32)); + asio::read_at(d, 42, asio::buffer(data, size), + asio::transfer_at_least(32)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -146003,12 +145882,12 @@ This operation is implemented in terms of zero or more calls to the device's rea [[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, + // Result of latest read_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -146084,9 +145963,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read_at( - d, 42, b, - asio::transfer_all()); + asio::read_at( + d, 42, b, + asio::transfer_all()); @@ -146147,9 +146026,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::read_at( - d, 42, b, - asio::transfer_all(), ec); + asio::read_at( + d, 42, b, + asio::transfer_all(), ec); @@ -146200,12 +146079,12 @@ This operation is implemented in terms of zero or more calls to the device's rea [[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, + // Result of latest read_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -146273,12 +146152,12 @@ This operation is implemented in terms of zero or more calls to the device's rea [[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, + // Result of latest read_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -146315,8 +146194,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v1 && buffers, char delim, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload1 more...]]`` template< @@ -146327,8 +146206,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v1 && buffers, char delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload2 more...]]`` template< @@ -146338,8 +146217,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v1 && buffers, string_view delim, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload3 more...]]`` template< @@ -146350,33 +146229,35 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v1 && buffers, string_view delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload4 more...]]`` Read data into a dynamic buffer sequence until some part of the data it contains matches a regular expression. template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``> + typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, + typename Traits> std::size_t ``[link asio.reference.read_until.overload5 read_until]``( SyncReadStream & s, DynamicBuffer_v1 && buffers, - const boost::regex & expr, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload5 more...]]`` template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``> + typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, + typename Traits> std::size_t ``[link asio.reference.read_until.overload6 read_until]``( SyncReadStream & s, DynamicBuffer_v1 && buffers, - const boost::regex & expr, + const boost::basic_regex< char, Traits > & expr, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload6 more...]]`` Read data into a dynamic buffer sequence until a function object indicates a match. @@ -146389,9 +146270,9 @@ Read data into a dynamic buffer sequence until a function object indicates a mat SyncReadStream & s, DynamicBuffer_v1 && buffers, MatchCondition match_condition, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload7 more...]]`` template< @@ -146403,9 +146284,9 @@ Read data into a dynamic buffer sequence until a function object indicates a mat DynamicBuffer_v1 && buffers, MatchCondition match_condition, asio::error_code & ec, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload8 more...]]`` Read data into a streambuf until it contains a specified delimiter. @@ -146452,20 +146333,22 @@ Read data into a streambuf until some part of the data it contains matches a reg template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename Allocator> + typename Allocator, + typename Traits> std::size_t ``[link asio.reference.read_until.overload13 read_until]``( SyncReadStream & s, asio::basic_streambuf< Allocator > & b, - const boost::regex & expr); + const boost::basic_regex< char, Traits > & expr); `` [''''»''' [link asio.reference.read_until.overload13 more...]]`` template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename Allocator> + typename Allocator, + typename Traits> std::size_t ``[link asio.reference.read_until.overload14 read_until]``( SyncReadStream & s, asio::basic_streambuf< Allocator > & b, - const boost::regex & expr, + const boost::basic_regex< char, Traits > & expr, asio::error_code & ec); `` [''''»''' [link asio.reference.read_until.overload14 more...]]`` @@ -146479,7 +146362,7 @@ Read data into a streambuf until a function object indicates a match. SyncReadStream & s, asio::basic_streambuf< Allocator > & b, MatchCondition match_condition, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload15 more...]]`` template< @@ -146491,7 +146374,7 @@ Read data into a streambuf until a function object indicates a match. asio::basic_streambuf< Allocator > & b, MatchCondition match_condition, asio::error_code & ec, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload16 more...]]`` Read data into a dynamic buffer sequence until it contains a specified delimiter. @@ -146503,7 +146386,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v2 buffers, char delim, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload17 more...]]`` template< @@ -146514,7 +146397,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v2 buffers, char delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload18 more...]]`` template< @@ -146524,7 +146407,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v2 buffers, string_view delim, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload19 more...]]`` template< @@ -146535,30 +146418,32 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v2 buffers, string_view delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload20 more...]]`` Read data into a dynamic buffer sequence until some part of the data it contains matches a regular expression. template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``> + typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, + typename Traits> std::size_t ``[link asio.reference.read_until.overload21 read_until]``( SyncReadStream & s, DynamicBuffer_v2 buffers, - const boost::regex & expr, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload21 more...]]`` template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``> + typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, + typename Traits> std::size_t ``[link asio.reference.read_until.overload22 read_until]``( SyncReadStream & s, DynamicBuffer_v2 buffers, - const boost::regex & expr, + const boost::basic_regex< char, Traits > & expr, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload22 more...]]`` Read data into a dynamic buffer sequence until a function object indicates a match. @@ -146571,8 +146456,8 @@ Read data into a dynamic buffer sequence until a function object indicates a mat SyncReadStream & s, DynamicBuffer_v2 buffers, MatchCondition match_condition, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload23 more...]]`` template< @@ -146584,13 +146469,13 @@ Read data into a dynamic buffer sequence until a function object indicates a mat DynamicBuffer_v2 buffers, MatchCondition match_condition, asio::error_code & ec, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.read_until.overload24 more...]]`` [heading Requirements] -['Header: ][^asio/read_until.hpp] +['Header: ][^asio/impl/read_until.hpp] ['Convenience header: ][^asio.hpp] @@ -146608,8 +146493,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v1 && buffers, char delim, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -146662,25 +146547,25 @@ After a successful read\_until operation, the dynamic buffer sequence may contai 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\n' } After the call to `erase`, the remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -146706,8 +146591,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v1 && buffers, char delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -146766,8 +146651,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v1 && buffers, string_view delim, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -146810,25 +146695,25 @@ After a successful read\_until operation, the dynamic buffer sequence may contai 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -146854,8 +146739,8 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v1 && buffers, string_view delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -146909,13 +146794,14 @@ Read data into a dynamic buffer sequence until some part of the data it contains template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``> + typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, + typename Traits> std::size_t read_until( SyncReadStream & s, DynamicBuffer_v1 && buffers, - const boost::regex & expr, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -146968,25 +146854,25 @@ After a successful read\_until operation, the dynamic buffer sequence may contai 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -147006,14 +146892,15 @@ Read data into a dynamic buffer sequence until some part of the data it contains template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``> + typename ``[link asio.reference.DynamicBuffer_v1 DynamicBuffer_v1]``, + typename Traits> std::size_t read_until( SyncReadStream & s, DynamicBuffer_v1 && buffers, - const boost::regex & expr, + const boost::basic_regex< char, Traits > & expr, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -147073,9 +146960,9 @@ Read data into a dynamic buffer sequence until a function object indicates a mat SyncReadStream & s, DynamicBuffer_v1 && buffers, MatchCondition match_condition, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -147100,11 +146987,11 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator + buffers_iterator `` 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.]] @@ -147130,6 +147017,9 @@ The number of bytes in the dynamic\_buffer's get area that have been fully consu 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. + +[heading Remarks] + 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. @@ -147138,20 +147028,20 @@ The default implementation of the `is_match_condition` type trait evaluates to t To read data into a dynamic buffer sequence until whitespace is encountered: typedef asio::buffers_iterator< - asio::const_buffers_1> iterator; - - std::pair - 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); + asio::const_buffers_1> iterator; + + std::pair + 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); @@ -147159,32 +147049,32 @@ To read data into a dynamic buffer sequence until whitespace is encountered: 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 - std::pair 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 - : public boost::true_type {}; - } // namespace asio - ... - std::string data; - asio::read_until(s, data, match_char('a')); + { + public: + explicit match_char(char c) : c_(c) {} + + template + std::pair 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 + : public boost::true_type {}; + } // namespace asio + ... + std::string data; + asio::read_until(s, data, match_char('a')); @@ -147209,9 +147099,9 @@ Read data into a dynamic buffer sequence until a function object indicates a mat DynamicBuffer_v1 && buffers, MatchCondition match_condition, asio::error_code & ec, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -147236,11 +147126,11 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator + buffers_iterator `` 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.]] @@ -147258,6 +147148,9 @@ The number of bytes in the dynamic buffer sequence's get area that have been ful 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. + +[heading Remarks] + 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. @@ -147332,25 +147225,25 @@ After a successful read\_until operation, the streambuf may contain additional d 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c' } The remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -147486,25 +147379,25 @@ After a successful read\_until operation, the streambuf may contain additional d 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r' } The remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -147583,11 +147476,12 @@ Read data into a streambuf until some part of the data it contains matches a reg template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename Allocator> + typename Allocator, + typename Traits> std::size_t read_until( SyncReadStream & s, asio::basic_streambuf< Allocator > & b, - const boost::regex & expr); + const boost::basic_regex< char, Traits > & 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: @@ -147640,25 +147534,25 @@ After a successful read\_until operation, the streambuf may contain additional d 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r' } The remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -147678,11 +147572,12 @@ Read data into a streambuf until some part of the data it contains matches a reg template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename Allocator> + typename Allocator, + typename Traits> std::size_t read_until( SyncReadStream & s, asio::basic_streambuf< Allocator > & b, - const boost::regex & expr, + const boost::basic_regex< char, Traits > & expr, asio::error_code & ec); @@ -147743,7 +147638,7 @@ Read data into a streambuf until a function object indicates a match. SyncReadStream & s, asio::basic_streambuf< Allocator > & b, MatchCondition match_condition, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 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: @@ -147768,11 +147663,11 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator::const_buffers_type> + buffers_iterator::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.]] @@ -147798,6 +147693,9 @@ The number of bytes in the streambuf's get area that have been fully consumed by 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. + +[heading Remarks] + 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. @@ -147806,20 +147704,20 @@ The default implementation of the `is_match_condition` type trait evaluates to t To read data into a streambuf until whitespace is encountered: typedef asio::buffers_iterator< - asio::streambuf::const_buffers_type> iterator; - - std::pair - 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); + asio::streambuf::const_buffers_type> iterator; + + std::pair + 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); @@ -147827,32 +147725,32 @@ To read data into a streambuf until whitespace is encountered: To read data into a streambuf until a matching character is found: class match_char - { - public: - explicit match_char(char c) : c_(c) {} - - template - std::pair 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 - : public boost::true_type {}; - } // namespace asio - ... - asio::streambuf b; - asio::read_until(s, b, match_char('a')); + { + public: + explicit match_char(char c) : c_(c) {} + + template + std::pair 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 + : public boost::true_type {}; + } // namespace asio + ... + asio::streambuf b; + asio::read_until(s, b, match_char('a')); @@ -147877,7 +147775,7 @@ Read data into a streambuf until a function object indicates a match. asio::basic_streambuf< Allocator > & b, MatchCondition match_condition, asio::error_code & ec, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 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: @@ -147902,11 +147800,11 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator::const_buffers_type> + buffers_iterator::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.]] @@ -147924,6 +147822,9 @@ The number of bytes in the streambuf's get area that have been fully consumed by 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. + +[heading Remarks] + 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. @@ -147946,7 +147847,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v2 buffers, char delim, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -147999,25 +147900,25 @@ After a successful read\_until operation, the dynamic buffer sequence may contai 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\n' } After the call to `erase`, the remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -148043,7 +147944,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v2 buffers, char delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148102,7 +148003,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter SyncReadStream & s, DynamicBuffer_v2 buffers, string_view delim, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148145,25 +148046,25 @@ After a successful read\_until operation, the dynamic buffer sequence may contai 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -148189,7 +148090,7 @@ Read data into a dynamic buffer sequence until it contains a specified delimiter DynamicBuffer_v2 buffers, string_view delim, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148243,12 +148144,13 @@ Read data into a dynamic buffer sequence until some part of the data it contains template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``> + typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, + typename Traits> std::size_t read_until( SyncReadStream & s, DynamicBuffer_v2 buffers, - const boost::regex & expr, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + const boost::basic_regex< char, Traits > & expr, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148301,25 +148203,25 @@ After a successful read\_until operation, the dynamic buffer sequence may contai 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); + 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', ... } + { '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' } + { 'a', 'b', ..., 'c', '\r', '\n' } After the call to `erase`, the remaining data is left in the buffer `b` as follows: - { 'd', 'e', ... } + { 'd', 'e', ... } This data may be the start of a new line, to be extracted by a subsequent `read_until` operation. @@ -148339,13 +148241,14 @@ Read data into a dynamic buffer sequence until some part of the data it contains template< typename ``[link asio.reference.SyncReadStream SyncReadStream]``, - typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``> + typename ``[link asio.reference.DynamicBuffer_v2 DynamicBuffer_v2]``, + typename Traits> std::size_t read_until( SyncReadStream & s, DynamicBuffer_v2 buffers, - const boost::regex & expr, + const boost::basic_regex< char, Traits > & expr, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148405,8 +148308,8 @@ Read data into a dynamic buffer sequence until a function object indicates a mat SyncReadStream & s, DynamicBuffer_v2 buffers, MatchCondition match_condition, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148431,11 +148334,11 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator + buffers_iterator `` 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.]] @@ -148461,6 +148364,9 @@ The number of bytes in the dynamic\_buffer's get area that have been fully consu 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. + +[heading Remarks] + 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. @@ -148469,20 +148375,20 @@ The default implementation of the `is_match_condition` type trait evaluates to t To read data into a dynamic buffer sequence until whitespace is encountered: typedef asio::buffers_iterator< - asio::const_buffers_1> iterator; - - std::pair - 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); + asio::const_buffers_1> iterator; + + std::pair + 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); @@ -148490,32 +148396,32 @@ To read data into a dynamic buffer sequence until whitespace is encountered: 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 - std::pair 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 - : public boost::true_type {}; - } // namespace asio - ... - std::string data; - asio::read_until(s, data, match_char('a')); + { + public: + explicit match_char(char c) : c_(c) {} + + template + std::pair 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 + : public boost::true_type {}; + } // namespace asio + ... + std::string data; + asio::read_until(s, data, match_char('a')); @@ -148540,8 +148446,8 @@ Read data into a dynamic buffer sequence until a function object indicates a mat DynamicBuffer_v2 buffers, MatchCondition match_condition, asio::error_code & ec, - typename constraint< is_match_condition< MatchCondition >::value >::type = 0, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_match_condition< MatchCondition >::value > = 0, + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -148566,11 +148472,11 @@ This operation is implemented in terms of zero or more calls to the stream's rea [[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be: `` - pair match_condition(iterator begin, iterator end); + pair match_condition(iterator begin, iterator end); `` where `iterator` represents the type: `` - buffers_iterator + buffers_iterator `` 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.]] @@ -148588,6 +148494,9 @@ The number of bytes in the dynamic buffer sequence's get area that have been ful 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. + +[heading Remarks] + 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. @@ -148812,7 +148721,7 @@ An allocator that caches memory blocks in thread-local storage for reuse. ] -The uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -149052,7 +148961,7 @@ The rebound `allocator` type. ] -The uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -149123,7 +149032,7 @@ A proto-allocator that caches memory blocks in thread-local storage for reuse. ] -The uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -149245,8 +149154,7 @@ No values are allocated by a proto-allocator. Rebind the allocator to another value\_type. - template< - typename U> + template<> struct recycling_allocator< void >::rebind @@ -149332,7 +149240,7 @@ The rebound `allocator` type. ] -The uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -149353,12 +149261,12 @@ The uses a simple strategy where a limited number of small memory blocks are ca [indexterm1 asio.indexterm.redirect_error..redirect_error] -Adapt a [link asio.overview.model.completion_tokens completion token] to capture [link asio.reference.error_code `error_code`] values to a variable. +Adapt a [link asio.overview.model.completion_tokens completion token] to capture error\_code values to a variable. template< typename CompletionToken> - redirect_error_t< typename decay< CompletionToken >::type > redirect_error( + redirect_error_t< decay_t< CompletionToken > > redirect_error( CompletionToken && completion_token, asio::error_code & ec); @@ -149378,7 +149286,7 @@ Adapt a [link asio.overview.model.completion_tokens completion token] to capture [indexterm1 asio.indexterm.redirect_error_t..redirect_error_t] -A [link asio.overview.model.completion_tokens completion token] adapter used to specify that an error produced by an asynchronous operation is captured to an [link asio.reference.error_code `error_code`] variable. +A [link asio.overview.model.completion_tokens completion token] adapter used to specify that an error produced by an asynchronous operation is captured to an error\_code variable. template< @@ -149413,7 +149321,7 @@ A [link asio.overview.model.completion_tokens completion token] adapter used to ] -The [link asio.reference.redirect_error_t `redirect_error_t`] class is used to indicate that any [link asio.reference.error_code `error_code`] produced by an asynchronous operation is captured to a specified variable. +The [link asio.reference.redirect_error_t `redirect_error_t`] class is used to indicate that any error\_code produced by an asynchronous operation is captured to a specified variable. [heading Requirements] @@ -149478,7 +149386,7 @@ Register buffers with an execution context. buffer_registration< MutableBufferSequence > ``[link asio.reference.register_buffers.overload1 register_buffers]``( const Executor & ex, const MutableBufferSequence & buffer_sequence, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.register_buffers.overload1 more...]]`` template< @@ -149489,7 +149397,7 @@ Register buffers with an execution context. const Executor & ex, const MutableBufferSequence & buffer_sequence, const Allocator & alloc, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.register_buffers.overload2 more...]]`` template< @@ -149498,7 +149406,7 @@ Register buffers with an execution context. buffer_registration< MutableBufferSequence > ``[link asio.reference.register_buffers.overload3 register_buffers]``( ExecutionContext & ctx, const MutableBufferSequence & buffer_sequence, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.register_buffers.overload3 more...]]`` template< @@ -149509,7 +149417,7 @@ Register buffers with an execution context. ExecutionContext & ctx, const MutableBufferSequence & buffer_sequence, const Allocator & alloc, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.register_buffers.overload4 more...]]`` [heading Requirements] @@ -149531,7 +149439,7 @@ Register buffers with an execution context. buffer_registration< MutableBufferSequence > register_buffers( const Executor & ex, const MutableBufferSequence & buffer_sequence, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -149553,7 +149461,7 @@ Register buffers with an execution context. const Executor & ex, const MutableBufferSequence & buffer_sequence, const Allocator & alloc, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); @@ -149573,7 +149481,7 @@ Register buffers with an execution context. buffer_registration< MutableBufferSequence > register_buffers( ExecutionContext & ctx, const MutableBufferSequence & buffer_sequence, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -149595,7 +149503,7 @@ Register buffers with an execution context. ExecutionContext & ctx, const MutableBufferSequence & buffer_sequence, const Allocator & alloc, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -149708,7 +149616,7 @@ The native buffer identifier type. Compare two IDs for equality. - friend bool operator!=( + bool operator!=( const registered_buffer_id & lhs, const registered_buffer_id & rhs); @@ -149730,7 +149638,7 @@ Compare two IDs for equality. Compare two IDs for equality. - friend bool operator==( + bool operator==( const registered_buffer_id & lhs, const registered_buffer_id & rhs); @@ -150900,7 +150808,8 @@ Implements changing the number of stop bits for a given serial port. Exception thrown when trying to add a duplicate service to an [link asio.reference.execution_context `execution_context`]. - class service_already_exists + class service_already_exists : + public std::logic_error [heading Member Functions] @@ -151048,23 +150957,23 @@ The [link asio.reference.basic_signal_set `basic_signal_set`] class provides the Performing an asynchronous wait: - void handler( - const asio::error_code& error, - int signal_number) - { - if (!error) - { - // A signal occurred. - } - } + 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); + // 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); + // Start an asynchronous wait for one of the signals to occur. + signals.async_wait(handler); @@ -151440,10 +151349,10 @@ Implements the SOL\_SOCKET/SO\_BROADCAST socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::broadcast option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option(true); + socket.set_option(option); @@ -151451,11 +151360,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::broadcast option; + socket.get_option(option); + bool is_set = option.value(); @@ -151491,11 +151400,11 @@ Implements the FIONREAD IO control command. - 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(); + 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(); @@ -151531,10 +151440,10 @@ Implements the SOL\_SOCKET/SO\_DEBUG socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::debug option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option(true); + socket.set_option(option); @@ -151542,11 +151451,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::debug option; + socket.get_option(option); + bool is_set = option.value(); @@ -151582,10 +151491,10 @@ Implements the SOL\_SOCKET/SO\_DONTROUTE socket option. Setting the option: - asio::ip::udp::socket socket(my_context); - ... - asio::socket_base::do_not_route option(true); - socket.set_option(option); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option(true); + socket.set_option(option); @@ -151593,11 +151502,11 @@ Setting the 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(); + asio::ip::udp::socket socket(my_context); + ... + asio::socket_base::do_not_route option; + socket.get_option(option); + bool is_set = option.value(); @@ -151633,10 +151542,10 @@ Implements a custom socket option that determines whether or not an accept opera Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::enable_connection_aborted option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option(true); + acceptor.set_option(option); @@ -151644,11 +151553,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::enable_connection_aborted option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -151684,10 +151593,10 @@ Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::keep_alive option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option(true); + socket.set_option(option); @@ -151695,11 +151604,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::keep_alive option; + socket.get_option(option); + bool is_set = option.value(); @@ -151735,10 +151644,10 @@ Implements the SOL\_SOCKET/SO\_LINGER socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::linger option(true, 30); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::linger option(true, 30); + socket.set_option(option); @@ -151746,12 +151655,12 @@ Setting the 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(); + 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(); @@ -151892,10 +151801,10 @@ Implements the SOL\_SOCKET/SO\_OOBINLINE socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::out_of_band_inline option(true); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option(true); + socket.set_option(option); @@ -151903,11 +151812,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::out_of_band_inline option; + socket.get_option(option); + bool value = option.value(); @@ -151943,10 +151852,10 @@ Implements the SOL\_SOCKET/SO\_RCVBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option(8192); + socket.set_option(option); @@ -151954,11 +151863,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -151994,10 +151903,10 @@ Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::receive_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option(1024); + socket.set_option(option); @@ -152005,11 +151914,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::receive_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -152045,10 +151954,10 @@ Implements the SOL\_SOCKET/SO\_REUSEADDR socket option. Setting the option: - asio::ip::tcp::acceptor acceptor(my_context); - ... - asio::socket_base::reuse_address option(true); - acceptor.set_option(option); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option(true); + acceptor.set_option(option); @@ -152056,11 +151965,11 @@ Setting the 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(); + asio::ip::tcp::acceptor acceptor(my_context); + ... + asio::socket_base::reuse_address option; + acceptor.get_option(option); + bool is_set = option.value(); @@ -152096,10 +152005,10 @@ Implements the SOL\_SOCKET/SO\_SNDBUF socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_buffer_size option(8192); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option(8192); + socket.set_option(option); @@ -152107,11 +152016,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_buffer_size option; + socket.get_option(option); + int size = option.value(); @@ -152147,10 +152056,10 @@ Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option. Setting the option: - asio::ip::tcp::socket socket(my_context); - ... - asio::socket_base::send_low_watermark option(1024); - socket.set_option(option); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option(1024); + socket.set_option(option); @@ -152158,11 +152067,11 @@ Setting the 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(); + asio::ip::tcp::socket socket(my_context); + ... + asio::socket_base::send_low_watermark option; + socket.get_option(option); + int size = option.value(); @@ -152285,12 +152194,12 @@ Start a new stackful coroutine that executes on a given executor. template< typename ``[link asio.reference.Executor1 Executor]``, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.spawn.overload1 spawn]``( + typename CompletionToken = default_completion_token_t> + auto ``[link asio.reference.spawn.overload1 spawn]``( const Executor & ex, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload1 more...]]`` Start a new stackful coroutine that executes on a given execution context. @@ -152298,12 +152207,12 @@ Start a new stackful coroutine that executes on a given execution context. template< typename ExecutionContext, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.spawn.overload2 spawn]``( + typename CompletionToken = default_completion_token_t< typename ExecutionContext::executor_type>> + auto ``[link asio.reference.spawn.overload2 spawn]``( ExecutionContext & ctx, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload2 more...]]`` Start a new stackful coroutine, inheriting the executor of another. @@ -152311,12 +152220,12 @@ Start a new stackful coroutine, inheriting the executor of another. template< typename ``[link asio.reference.Executor1 Executor]``, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.spawn.overload3 spawn]``( + typename CompletionToken = default_completion_token_t> + auto ``[link asio.reference.spawn.overload3 spawn]``( const basic_yield_context< Executor > & ctx, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload3 more...]]`` Start a new stackful coroutine that executes on a given executor. @@ -152325,14 +152234,14 @@ Start a new stackful coroutine that executes on a given executor. typename ``[link asio.reference.Executor1 Executor]``, typename StackAllocator, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.spawn.overload4 spawn]``( + typename CompletionToken = default_completion_token_t> + auto ``[link asio.reference.spawn.overload4 spawn]``( const Executor & ex, allocator_arg_t , StackAllocator && stack_allocator, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload4 more...]]`` Start a new stackful coroutine that executes on a given execution context. @@ -152341,14 +152250,14 @@ Start a new stackful coroutine that executes on a given execution context. typename ExecutionContext, typename StackAllocator, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.spawn.overload5 spawn]``( + typename CompletionToken = default_completion_token_t< typename ExecutionContext::executor_type>> + auto ``[link asio.reference.spawn.overload5 spawn]``( ExecutionContext & ctx, allocator_arg_t , StackAllocator && stack_allocator, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload5 more...]]`` Start a new stackful coroutine, inheriting the executor of another. @@ -152357,14 +152266,14 @@ Start a new stackful coroutine, inheriting the executor of another. typename ``[link asio.reference.Executor1 Executor]``, typename StackAllocator, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.spawn.overload6 spawn]``( + typename CompletionToken = default_completion_token_t> + auto ``[link asio.reference.spawn.overload6 spawn]``( const basic_yield_context< Executor > & ctx, allocator_arg_t , StackAllocator && stack_allocator, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload6 more...]]`` (Deprecated: Use overloads with a completion token.) Start a new stackful coroutine, calling the specified handler when it completes. @@ -152383,7 +152292,7 @@ Start a new stackful coroutine, inheriting the executor of another. Handler && handler, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), - typename constraint< !is_executor< typename decay< Handler >::type >::value &&!execution::is_executor< typename decay< Handler >::type >::value &&!is_convertible< Handler &, execution_context & >::value >::type = 0); + constraint_t< !is_executor< decay_t< Handler > >::value &&!execution::is_executor< decay_t< Handler > >::value &&!is_convertible< Handler &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload8 more...]]`` (Deprecated: Use overloads with a completion token.) Start a new stackful coroutine, inheriting the execution context of another. @@ -152406,7 +152315,7 @@ Start a new stackful coroutine, inheriting the executor of another. const Executor & ex, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload10 more...]]`` (Deprecated: Use overloads with a completion token.) Start a new stackful coroutine that executes on a given strand. @@ -152439,46 +152348,46 @@ Start a new stackful coroutine, inheriting the executor of another. ExecutionContext & ctx, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.spawn.overload13 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: +The [link asio.reference.spawn `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, asio::detached); - // ... + // ... - 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); + 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) - { - // ... - } - } + asio::async_write(my_socket, + asio::buffer(data, length), yield); + } + } + catch (std::exception& e) + { + // ... + } + } [heading Requirements] -['Header: ][^asio/spawn.hpp] +['Header: ][^asio/impl/spawn.hpp] -['Convenience header: ]None +['Convenience header: ][^asio.hpp] [section:overload1 spawn (1 of 13 overloads)] @@ -152490,12 +152399,12 @@ Start a new stackful coroutine that executes on a given executor. template< typename ``[link asio.reference.Executor1 Executor]``, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` spawn( + typename CompletionToken = default_completion_token_t> + auto spawn( const Executor & ex, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); This function is used to launch a new stackful coroutine. @@ -152510,7 +152419,7 @@ This function is used to launch a new stackful coroutine. [[function][The coroutine function. The function must be callable the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -152520,12 +152429,12 @@ This function is used to launch a new stackful coroutine. - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -152535,7 +152444,7 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the return type of the function object. @@ -152561,12 +152470,12 @@ Start a new stackful coroutine that executes on a given execution context. template< typename ExecutionContext, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` spawn( + typename CompletionToken = default_completion_token_t< typename ExecutionContext::executor_type>> + auto spawn( ExecutionContext & ctx, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This function is used to launch a new stackful coroutine. @@ -152581,7 +152490,7 @@ This function is used to launch a new stackful coroutine. [[function][The coroutine function. The function must be callable the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -152591,12 +152500,12 @@ This function is used to launch a new stackful coroutine. - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -152606,7 +152515,7 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the return type of the function object. @@ -152632,12 +152541,12 @@ Start a new stackful coroutine, inheriting the executor of another. template< typename ``[link asio.reference.Executor1 Executor]``, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` spawn( + typename CompletionToken = default_completion_token_t> + auto spawn( const basic_yield_context< Executor > & ctx, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); This function is used to launch a new stackful coroutine. @@ -152652,7 +152561,7 @@ This function is used to launch a new stackful coroutine. [[function][The coroutine function. The function must be callable the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -152662,12 +152571,12 @@ This function is used to launch a new stackful coroutine. - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -152677,7 +152586,7 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the return type of the function object. @@ -152704,14 +152613,14 @@ Start a new stackful coroutine that executes on a given executor. typename ``[link asio.reference.Executor1 Executor]``, typename StackAllocator, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` spawn( + typename CompletionToken = default_completion_token_t> + auto spawn( const Executor & ex, allocator_arg_t , StackAllocator && stack_allocator, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); This function is used to launch a new stackful coroutine using the specified stack allocator. @@ -152728,7 +152637,7 @@ This function is used to launch a new stackful coroutine using the specified sta [[function][The coroutine function. The function must be callable the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -152738,12 +152647,12 @@ This function is used to launch a new stackful coroutine using the specified sta - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -152753,7 +152662,7 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the return type of the function object. @@ -152780,14 +152689,14 @@ Start a new stackful coroutine that executes on a given execution context. typename ExecutionContext, typename StackAllocator, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` spawn( + typename CompletionToken = default_completion_token_t< typename ExecutionContext::executor_type>> + auto spawn( ExecutionContext & ctx, allocator_arg_t , StackAllocator && stack_allocator, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This function is used to launch a new stackful coroutine. @@ -152804,7 +152713,7 @@ This function is used to launch a new stackful coroutine. [[function][The coroutine function. The function must be callable the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -152814,12 +152723,12 @@ This function is used to launch a new stackful coroutine. - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -152829,7 +152738,7 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the return type of the function object. @@ -152856,14 +152765,14 @@ Start a new stackful coroutine, inheriting the executor of another. typename ``[link asio.reference.Executor1 Executor]``, typename StackAllocator, typename F, - typename CompletionToken = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` spawn( + typename CompletionToken = default_completion_token_t> + auto spawn( const basic_yield_context< Executor > & ctx, allocator_arg_t , StackAllocator && stack_allocator, F && function, - CompletionToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); This function is used to launch a new stackful coroutine using the specified stack allocator. @@ -152880,7 +152789,7 @@ This function is used to launch a new stackful coroutine using the specified sta [[function][The coroutine function. The function must be callable the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -152890,12 +152799,12 @@ This function is used to launch a new stackful coroutine using the specified sta - void handler(std::exception_ptr); + void handler(std::exception_ptr); Otherwise, the function signature of the completion handler must be: - void handler(std::exception_ptr, R); + void handler(std::exception_ptr, R); @@ -152905,7 +152814,7 @@ Otherwise, the function signature of the completion handler must be: - void(std::exception_ptr, R) + void(std::exception_ptr, R) where `R` is the return type of the function object. @@ -152945,7 +152854,7 @@ This function is used to launch a new coroutine. [[function][The coroutine function. The function must have the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` where Executor is the associated executor type of `Function`.]] @@ -152973,7 +152882,7 @@ where Executor is the associated executor type of `Function`.]] Handler && handler, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), - typename constraint< !is_executor< typename decay< Handler >::type >::value &&!execution::is_executor< typename decay< Handler >::type >::value &&!is_convertible< Handler &, execution_context & >::value >::type = 0); + constraint_t< !is_executor< decay_t< Handler > >::value &&!execution::is_executor< decay_t< Handler > >::value &&!is_convertible< Handler &, execution_context & >::value > = 0); This function is used to launch a new coroutine. @@ -152986,13 +152895,13 @@ This function is used to launch a new coroutine. [[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(); + void handler(); `` ]] [[function][The coroutine function. The function must have the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` where Executor is the associated executor type of `Handler`.]] @@ -153034,7 +152943,7 @@ This function is used to launch a new coroutine. [[function][The coroutine function. The function must have the signature: `` - void function(basic_yield_context yield); + void function(basic_yield_context yield); `` ]] @@ -153062,7 +152971,7 @@ This function is used to launch a new coroutine. const Executor & ex, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), - typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); This function is used to launch a new coroutine. @@ -153077,7 +152986,7 @@ This function is used to launch a new coroutine. [[function][The coroutine function. The function must have the signature: `` - void function(yield_context yield); + void function(yield_context yield); `` ]] @@ -153119,7 +153028,7 @@ This function is used to launch a new coroutine. [[function][The coroutine function. The function must have the signature: `` - void function(yield_context yield); + void function(yield_context yield); `` ]] @@ -153160,7 +153069,7 @@ This function is used to launch a new coroutine. [[function][The coroutine function. The function must have the signature: `` - void function(yield_context yield); + void function(yield_context yield); `` ]] @@ -153188,7 +153097,7 @@ This function is used to launch a new coroutine. ExecutionContext & ctx, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This function is used to launch a new coroutine. @@ -153203,7 +153112,7 @@ This function is used to launch a new coroutine. [[function][The coroutine function. The function must have the signature: `` - void function(yield_context yield); + void function(yield_context yield); `` ]] @@ -154604,9 +154513,9 @@ This function is used to specify a callback function to obtain password informat [[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. - ); + 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.]] @@ -154658,9 +154567,9 @@ This function is used to specify a callback function to obtain password informat [[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. - ); + 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.]] @@ -154724,9 +154633,9 @@ This function is used to specify a callback function that will be called by the [[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. - ); + 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.]] @@ -154778,9 +154687,9 @@ This function is used to specify a callback function that will be called by the [[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. - ); + 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.]] @@ -156703,28 +156612,28 @@ Verifies a certificate against a host\_name according to the rules described in 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 ssl_socket; + using asio::ip::tcp; + namespace ssl = asio::ssl; + typedef ssl::stream 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(); + // 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)); + // 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); + // 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 ... + // ... read and write as normal ... @@ -156837,28 +156746,28 @@ The type of the function object's result. 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 ssl_socket; + using asio::ip::tcp; + namespace ssl = asio::ssl; + typedef ssl::stream 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(); + // 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)); + // 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); + // 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 ... + // ... read and write as normal ... @@ -157103,9 +157012,9 @@ The stream class template provides asynchronous and blocking stream-oriented fun 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 sock(my_context, ctx); + asio::io_context my_context; + asio::ssl::context ctx(asio::ssl::context::sslv23); + asio::ssl::stream sock(my_context, ctx); @@ -157126,19 +157035,19 @@ Start an asynchronous SSL handshake. template< - typename ``[link asio.reference.HandshakeToken HandshakeToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ssl__stream.async_handshake.overload1 async_handshake]``( + typename ``[link asio.reference.HandshakeToken HandshakeToken]`` = default_completion_token_t> + auto ``[link asio.reference.ssl__stream.async_handshake.overload1 async_handshake]``( handshake_type type, - HandshakeToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + HandshakeToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ssl__stream.async_handshake.overload1 more...]]`` template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.BufferedHandshakeToken BufferedHandshakeToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link asio.reference.ssl__stream.async_handshake.overload2 async_handshake]``( + typename ``[link asio.reference.BufferedHandshakeToken BufferedHandshakeToken]`` = default_completion_token_t> + auto ``[link asio.reference.ssl__stream.async_handshake.overload2 async_handshake]``( handshake_type type, const ConstBufferSequence & buffers, - BufferedHandshakeToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + BufferedHandshakeToken && token = default_completion_token_t< executor_type >()); `` [''''»''' [link asio.reference.ssl__stream.async_handshake.overload2 more...]]`` @@ -157149,10 +157058,10 @@ Start an asynchronous SSL handshake. template< - typename ``[link asio.reference.HandshakeToken HandshakeToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_handshake( + typename ``[link asio.reference.HandshakeToken HandshakeToken]`` = default_completion_token_t> + auto async_handshake( handshake_type type, - HandshakeToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + HandshakeToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously perform an SSL handshake on the stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -157168,8 +157077,8 @@ This function is used to asynchronously perform an SSL handshake on the stream. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the handshake completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -157180,7 +157089,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -157211,11 +157120,11 @@ Start an asynchronous SSL handshake. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.BufferedHandshakeToken BufferedHandshakeToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_handshake( + typename ``[link asio.reference.BufferedHandshakeToken BufferedHandshakeToken]`` = default_completion_token_t> + auto async_handshake( handshake_type type, const ConstBufferSequence & buffers, - BufferedHandshakeToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + BufferedHandshakeToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously perform an SSL handshake on the stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -157233,9 +157142,9 @@ This function is used to asynchronously perform an SSL handshake on the stream. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the handshake completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Amount of buffers used in handshake. - ); + const asio::error_code& error, // Result of operation. + std::size_t bytes_transferred // Amount of buffers used in handshake. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -157246,7 +157155,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -157279,10 +157188,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read one or more bytes of data from the stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -157298,9 +157207,9 @@ This function is used to asynchronously read one or more bytes of data from the [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -157311,7 +157220,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -157346,9 +157255,9 @@ Asynchronously shut down SSL on the stream. template< - typename ``[link asio.reference.ShutdownToken ShutdownToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_shutdown( - ShutdownToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.ShutdownToken ShutdownToken]`` = default_completion_token_t> + auto async_shutdown( + ShutdownToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously shut down SSL on the stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -157362,8 +157271,8 @@ This function is used to asynchronously shut down SSL on the stream. It is an in [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the shutdown completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -157374,7 +157283,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -157405,10 +157314,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write one or more bytes of data to the stream. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -157424,9 +157333,9 @@ This function is used to asynchronously write one or more bytes of data to the s [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -157437,7 +157346,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -157821,17 +157730,17 @@ This function may be used to obtain the underlying implementation of the context 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 sock(my_context, ctx); + asio::ssl::stream sock(my_context, ctx); - // ... establish connection and perform handshake ... + // ... 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) - { - // ... - } - } + if (X509* cert = SSL_get_peer_certificate(sock.native_handle())) + { + if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK) + { + // ... + } + } @@ -157930,7 +157839,7 @@ A reference to the next layer in the stack of stream layers. Ownership is not tr The type of the next layer. - typedef remove_reference< Stream >::type next_layer_type; + typedef remove_reference_t< Stream > next_layer_type; @@ -158130,9 +158039,9 @@ This function is used to specify a callback function that will be called by the [[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. - ); + 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.]] @@ -158184,9 +158093,9 @@ This function is used to specify a callback function that will be called by the [[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. - ); + 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.]] @@ -159138,13 +159047,6 @@ Verify the peer. ] - [ - - [[link asio.reference.thread_pool.scheduler_type [*scheduler_type]]] - [Scheduler used to schedule receivers on a thread pool. ] - - ] - ] [heading Member Functions] @@ -159176,11 +159078,6 @@ Verify the peer. [Notify the execution_context of a fork-related event. ] ] - [ - [[link asio.reference.thread_pool.scheduler [*scheduler]]] - [Obtains the scheduler associated with the pool. ] - ] - [ [[link asio.reference.thread_pool.stop [*stop]]] [Stops the threads. ] @@ -159221,32 +159118,6 @@ Verify the peer. ] -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.thread_pool.add_service [*add_service]]] - [(Deprecated: Use make_service().) Add a service object to the execution_context. ] - ] - - [ - [[link asio.reference.thread_pool.has_service [*has_service]]] - [Determine if an execution_context contains a specified service type. ] - ] - - [ - [[link asio.reference.thread_pool.make_service [*make_service]]] - [Creates a service object and adds it to the execution_context. ] - ] - - [ - [[link asio.reference.thread_pool.use_service [*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. @@ -159261,27 +159132,27 @@ For example: void my_task() - { - ... - } + { + ... + } - ... + ... - // Launch the pool with four threads. - asio::thread_pool pool(4); + // Launch the pool with four threads. + asio::thread_pool pool(4); - // Submit a function to the pool. - asio::post(pool, my_task); + // Submit a function to the pool. + asio::post(pool, my_task); - // Submit a lambda object to the pool. - asio::post(pool, - []() - { - ... - }); + // Submit a lambda object to the pool. + asio::post(pool, + []() + { + ... + }); - // Wait for all tasks in the pool to complete. - pool.join(); + // Wait for all tasks in the pool to complete. + pool.join(); @@ -159461,14 +159332,14 @@ This waitable timer functionality is for use with the C++11 standard library's ` Performing a blocking wait (C++11): - // Construct a timer without setting an expiry time. - asio::steady_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_after(std::chrono::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -159476,22 +159347,22 @@ Performing a blocking wait (C++11): Performing an asynchronous wait (C++11): - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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)); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -159505,26 +159376,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -159540,7 +159411,7 @@ Changing the expiry time of a timer while there are pending asynchronous waits c This typedef uses the C++11 `` standard library facility, if available. Otherwise, it may use the Boost.Chrono library. To explicitly utilise Boost.Chrono, use the [link asio.reference.basic_waitable_timer `basic_waitable_timer`] template directly: - typedef basic_waitable_timer timer; + typedef basic_waitable_timer timer; @@ -159737,9 +159608,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -159776,9 +159647,9 @@ This function is used to ask the strand to execute the given function object on [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -159801,7 +159672,7 @@ Request the strand to invoke the given function object. template< typename Function> - constraint< traits::execute_member< const Executor &, Function >::is_valid, void >::type execute( + constraint_t< traits::execute_member< const Executor &, Function >::is_valid, void > execute( Function && f) const; @@ -159813,9 +159684,9 @@ This function is used to ask the strand to execute the given function object on [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -159901,7 +159772,7 @@ The strand delegates this call to its underlying executor. Compare two strands for inequality. - friend bool operator!=( + bool operator!=( const strand & a, const strand & b); @@ -160033,7 +159904,7 @@ This assignment operator is only valid if the `OtherExecutor` type is convertibl Compare two strands for equality. - friend bool operator==( + bool operator==( const strand & a, const strand & b); @@ -160073,9 +159944,9 @@ This function is used to ask the executor to execute the given function object. [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -160098,7 +159969,7 @@ Forward a preference to the underlying executor. template< typename Property> - constraint< can_prefer< const Executor &, Property >::value &&!is_convertible< Property, execution::blocking_t::always_t >::value, strand< typename decay< typename prefer_result< const Executor &, Property >::type >::type > >::type prefer( + constraint_t< can_prefer< const Executor &, Property >::value &&!is_convertible< Property, execution::blocking_t::always_t >::value, strand< decay_t< prefer_result_t< const Executor &, Property > > > > prefer( const Property & p) const; @@ -160107,8 +159978,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::strand ex1 = ...; - auto ex2 = asio::prefer(ex1, - asio::execution::blocking.never); + auto ex2 = asio::prefer(ex1, + asio::execution::blocking.never); @@ -160126,7 +159997,7 @@ Forward a query to the underlying executor. template< typename Property> - constraint< can_query< const Executor &, Property >::value, typename conditional< is_convertible< Property, execution::blocking_t >::value, execution::blocking_t, typename query_result< const Executor &, Property >::type >::type >::type query( + constraint_t< can_query< const Executor &, Property >::value, conditional_t< is_convertible< Property, execution::blocking_t >::value, execution::blocking_t, query_result_t< const Executor &, Property > > > query( const Property & p) const; @@ -160135,9 +160006,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::strand ex = ...; - if (asio::query(ex, asio::execution::blocking) - == asio::execution::blocking.never) - ... + if (asio::query(ex, asio::execution::blocking) + == asio::execution::blocking.never) + ... @@ -160155,7 +160026,7 @@ Forward a requirement to the underlying executor. template< typename Property> - constraint< can_require< const Executor &, Property >::value &&!is_convertible< Property, execution::blocking_t::always_t >::value, strand< typename decay< typename require_result< const Executor &, Property >::type >::type > >::type require( + constraint_t< can_require< const Executor &, Property >::value &&!is_convertible< Property, execution::blocking_t::always_t >::value, strand< decay_t< require_result_t< const Executor &, Property > > > > require( const Property & p) const; @@ -160164,8 +160035,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: asio::strand ex1 = ...; - auto ex2 = asio::require(ex1, - asio::execution::blocking.never); + auto ex2 = asio::require(ex1, + asio::execution::blocking.never); @@ -160212,7 +160083,7 @@ Construct a strand for the specified executor. typename ``[link asio.reference.Executor1 Executor1]``> explicit ``[link asio.reference.strand.strand.overload2 strand]``( const Executor1 & e, - typename constraint< conditional< !is_same< Executor1, strand >::value, is_convertible< Executor1, Executor >, false_type >::type::value >::type = 0); + constraint_t< conditional_t< !is_same< Executor1, strand >::value, is_convertible< Executor1, Executor >, false_type >::value > = 0); `` [''''»''' [link asio.reference.strand.strand.overload2 more...]]`` @@ -160278,7 +160149,7 @@ Construct a strand for the specified executor. typename ``[link asio.reference.Executor1 Executor1]``> strand( const Executor1 & e, - typename constraint< conditional< !is_same< Executor1, strand >::value, is_convertible< Executor1, Executor >, false_type >::type::value >::type = 0); + constraint_t< conditional_t< !is_same< Executor1, strand >::value, is_convertible< Executor1, Executor >, false_type >::value > = 0); @@ -160722,7 +160593,7 @@ The `basic_streambuf` class's public interface is intended to permit the followi The constructor for [link asio.reference.basic_streambuf `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() + 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`. @@ -160734,33 +160605,33 @@ The constructor for `basic_streambuf` takes an Allocator argument. A copy of thi Writing directly from an streambuf to a socket: - asio::streambuf b; - std::ostream os(&b); - os << "Hello, World!\n"; + 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()); + // try sending some data in input sequence + size_t n = sock.send(b.data()); - b.consume(n); // sent data is removed from input sequence + b.consume(n); // sent data is removed from input sequence Reading from a socket directly into a streambuf: - asio::streambuf b; + asio::streambuf b; - // reserve 512 bytes in output sequence - asio::streambuf::mutable_buffers_type bufs = b.prepare(512); + // reserve 512 bytes in output sequence + asio::streambuf::mutable_buffers_type bufs = b.prepare(512); - size_t n = sock.receive(bufs); + size_t n = sock.receive(bufs); - // received data is "committed" from output sequence to input sequence - b.commit(n); + // received data is "committed" from output sequence to input sequence + b.commit(n); - std::istream is(&b); - std::string s; - is >> s; + std::istream is(&b); + std::string s; + is >> s; @@ -160789,7 +160660,7 @@ Returns the error category used for the system errors produced by asio. [heading Requirements] -['Header: ][^asio/error_code.hpp] +['Header: ][^asio/impl/error_code.ipp] ['Convenience header: ][^asio.hpp] @@ -160881,32 +160752,6 @@ The executor context for the system executor. ] -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.system_context.add_service [*add_service]]] - [(Deprecated: Use make_service().) Add a service object to the execution_context. ] - ] - - [ - [[link asio.reference.system_context.has_service [*has_service]]] - [Determine if an execution_context contains a specified service type. ] - ] - - [ - [[link asio.reference.system_context.make_service [*make_service]]] - [Creates a service object and adds it to the execution_context. ] - ] - - [ - [[link asio.reference.system_context.use_service [*use_service]]] - [Obtain the service object corresponding to the given type. ] - ] - -] - [heading Requirements] ['Header: ][^asio/system_context.hpp] @@ -160914,65 +160759,6 @@ The executor context for the system executor. ['Convenience header: ][^asio.hpp] -[section:add_service system_context::add_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.system_context.add_service..add_service..system_context] -(Deprecated: Use `make_service()`.) Add a service object to the [link asio.reference.execution_context `execution_context`]. - - - template< - typename ``[link asio.reference.Service Service]``> - friend void add_service( - execution_context & e, - Service * svc); - - -This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: -`` - delete static_cast(svc) -`` -]] - -] - - -[heading Exceptions] - - -[variablelist - -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] - -[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] - -] - - - -[heading Requirements] - -['Header: ][^asio/system_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:destroy system_context::destroy] @@ -161171,51 +160957,6 @@ Obtain an executor for the context. -[section:has_service system_context::has_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.system_context.has_service..has_service..system_context] -Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. - - - template< - typename ``[link asio.reference.Service Service]``> - friend bool has_service( - execution_context & e); - - -This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -] - - -[heading Return Value] - -A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. - - - -[heading Requirements] - -['Header: ][^asio/system_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:join system_context::join] [indexterm2 asio.indexterm.system_context.join..join..system_context] @@ -161230,60 +160971,6 @@ Join all threads in the system thread pool. -[section:make_service system_context::make_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.system_context.make_service..make_service..system_context] -Creates a service object and adds it to the [link asio.reference.execution_context `execution_context`]. - - - template< - typename ``[link asio.reference.Service Service]``, - typename... Args> - friend Service & make_service( - execution_context & e, - Args &&... args); - - -This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -[[args][Zero or more arguments to be passed to the service constructor.]] - -] - - -[heading Exceptions] - - -[variablelist - -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`]. ]] - -] - - - -[heading Requirements] - -['Header: ][^asio/system_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:notify_fork system_context::notify_fork] @@ -161299,7 +160986,7 @@ Notify the [link asio.reference.execution_context `execution_context`] of a fork This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `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 [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. [heading Parameters] @@ -161327,16 +161014,16 @@ This function must not be called while any other [link asio.reference.execution_ 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); - } + 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); + } @@ -161404,121 +161091,6 @@ Determine whether the system thread pool has been stopped. [endsect] -[section:use_service system_context::use_service] - -[indexterm2 asio.indexterm.system_context.use_service..use_service..system_context] -Obtain the service object corresponding to the given type. - - - template< - typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.system_context.use_service.overload1 use_service]``( - execution_context & e); - `` [''''»''' [link asio.reference.system_context.use_service.overload1 more...]]`` - - template< - typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.system_context.use_service.overload2 use_service]``( - io_context & ioc); - `` [''''»''' [link asio.reference.system_context.use_service.overload2 more...]]`` - - -[section:overload1 system_context::use_service (1 of 2 overloads)] - - -['Inherited from execution_context.] - - -Obtain the service object corresponding to the given type. - - - template< - typename ``[link asio.reference.Service 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 [link asio.reference.execution_context `execution_context`] will create a new instance of the service. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -] - - -[heading Return Value] - -The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. - - - -[heading Requirements] - -['Header: ][^asio/system_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:overload2 system_context::use_service (2 of 2 overloads)] - - -['Inherited from execution_context.] - - -Obtain the service object corresponding to the given type. - - - template< - typename ``[link asio.reference.Service 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 [link asio.reference.io_context `io_context`] will create a new instance of the service. - - -[heading Parameters] - - -[variablelist - -[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] - -] - - -[heading Return Value] - -The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. - - -[heading Remarks] - -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. - - - -[heading Requirements] - -['Header: ][^asio/system_context.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - -[endsect] - [section:_system_context system_context::~system_context] @@ -161536,53 +161108,16 @@ Destructor shuts down all threads in the system thread pool. [endsect] + [section:system_error system_error] [indexterm1 asio.indexterm.system_error..system_error] -The [link asio.reference.system_error `system_error`] class is used to represent system conditions that prevent the library from operating correctly. - + typedef std::system_error system_error; - class system_error : - public std::exception -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.system_error.code [*code]]] - [Get the error code associated with the exception. ] - ] - - [ - [[link asio.reference.system_error.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - - [ - [[link asio.reference.system_error.system_error [*system_error]] [constructor]] - [Construct with an error code. - [hr] - Construct with an error code and context. - [hr] - Copy constructor. ] - ] - - [ - [[link asio.reference.system_error.what [*what]]] - [Get a string representation of the exception. ] - ] - - [ - [[link asio.reference.system_error._system_error [*~system_error]] [destructor]] - [Destructor. ] - ] - -] - [heading Requirements] ['Header: ][^asio/system_error.hpp] @@ -161590,140 +161125,9 @@ The [link asio.reference.system_error `system_error`] class is used to represent ['Convenience header: ][^asio.hpp] -[section:code system_error::code] - -[indexterm2 asio.indexterm.system_error.code..code..system_error] -Get the error code associated with the exception. - - - error_code code() const; - - - -[endsect] - - - -[section:operator_eq_ system_error::operator=] - -[indexterm2 asio.indexterm.system_error.operator_eq_..operator=..system_error] -Assignment operator. - - - system_error & operator=( - const system_error & e); - - - -[endsect] - - -[section:system_error system_error::system_error] - -[indexterm2 asio.indexterm.system_error.system_error..system_error..system_error] -Construct with an error code. - - - ``[link asio.reference.system_error.system_error.overload1 system_error]``( - const error_code & ec); - `` [''''»''' [link asio.reference.system_error.system_error.overload1 more...]]`` - - -Construct with an error code and context. - - - ``[link asio.reference.system_error.system_error.overload2 system_error]``( - const error_code & ec, - const std::string & context); - `` [''''»''' [link asio.reference.system_error.system_error.overload2 more...]]`` - - -Copy constructor. - - - ``[link asio.reference.system_error.system_error.overload3 system_error]``( - const system_error & other); - `` [''''»''' [link asio.reference.system_error.system_error.overload3 more...]]`` - - -[section:overload1 system_error::system_error (1 of 3 overloads)] - - -Construct with an error code. - - - system_error( - const error_code & ec); - - - -[endsect] - - - -[section:overload2 system_error::system_error (2 of 3 overloads)] - - -Construct with an error code and context. - - - system_error( - const error_code & ec, - const std::string & context); - - - -[endsect] - - - -[section:overload3 system_error::system_error (3 of 3 overloads)] - - -Copy constructor. - - - system_error( - const system_error & other); - - - -[endsect] - - [endsect] -[section:what system_error::what] - -[indexterm2 asio.indexterm.system_error.what..what..system_error] -Get a string representation of the exception. - - - virtual const char * what() const; - - - -[endsect] - - - -[section:_system_error system_error::~system_error] - -[indexterm2 asio.indexterm.system_error._system_error..~system_error..system_error] -Destructor. - - - virtual ~system_error(); - - - -[endsect] - - - -[endsect] - [section:system_executor system_executor] @@ -162011,14 +161415,14 @@ This waitable timer functionality is for use with the C++11 standard library's ` Performing a blocking wait (C++11): - // Construct a timer without setting an expiry time. - asio::steady_timer timer(my_context); + // 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)); + // Set an expiry time relative to now. + timer.expires_after(std::chrono::seconds(5)); - // Wait for the timer to expire. - timer.wait(); + // Wait for the timer to expire. + timer.wait(); @@ -162026,22 +161430,22 @@ Performing a blocking wait (C++11): Performing an asynchronous wait (C++11): - void handler(const asio::error_code& error) - { - if (!error) - { - // Timer expired. - } - } + 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)); + // 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); + // Start an asynchronous wait. + timer.async_wait(handler); @@ -162055,26 +161459,26 @@ Changing the expiry time of a timer while there are pending asynchronous waits c - 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_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. - } - } + void on_timeout(const asio::error_code& e) + { + if (e != asio::error::operation_aborted) + { + // Timer was not cancelled, take necessary action. + } + } @@ -162090,7 +161494,7 @@ Changing the expiry time of a timer while there are pending asynchronous waits c This typedef uses the C++11 `` standard library facility, if available. Otherwise, it may use the Boost.Chrono library. To explicitly utilise Boost.Chrono, use the [link asio.reference.basic_waitable_timer `basic_waitable_timer`] template directly: - typedef basic_waitable_timer timer; + typedef basic_waitable_timer timer; @@ -162122,15 +161526,15 @@ Awaitable object that returns the cancellation state of the current coroutine. asio::awaitable my_coroutine() - { - asio::cancellation_state cs - = co_await asio::this_coro::cancellation_state; + { + asio::cancellation_state cs + = co_await asio::this_coro::cancellation_state; - // ... + // ... - if (cs.cancelled() != asio::cancellation_type::none) - // ... - } + if (cs.cancelled() != asio::cancellation_type::none) + // ... + } @@ -162301,11 +161705,11 @@ Let `P` be the cancellation slot associated with the current coroutine's [link a asio::awaitable my_coroutine() - { - co_await asio::this_coro::reset_cancellation_state(); + { + co_await asio::this_coro::reset_cancellation_state(); - // ... - } + // ... + } @@ -162313,7 +161717,8 @@ Let `P` be the cancellation slot associated with the current coroutine's [link a [heading Remarks] -The cancellation state is shared by all coroutines in the same "thread of execution" that was created using [link asio.reference.co_spawn `co_spawn`]. +The cancellation state is shared by all coroutines in the same "thread +of execution" that was created using [link asio.reference.co_spawn `co_spawn`]. @@ -162334,7 +161739,8 @@ Returns an awaitable object that may be used to reset the cancellation state of Filter && filter); -Let `P` be the cancellation slot associated with the current coroutine's [link asio.reference.co_spawn `co_spawn`] completion handler. Assigns a new [link asio.reference.cancellation_state `cancellation_state`] object `S`, constructed as `S(P, std::forward(filter))`, into the current coroutine's cancellation state object. +Let `P` be the cancellation slot associated with the current coroutine's [link asio.reference.co_spawn `co_spawn`] completion handler. Assigns a new [link asio.reference.cancellation_state `cancellation_state`] object `S`, constructed as `S(P, +std::forward(filter))`, into the current coroutine's cancellation state object. [heading Example] @@ -162342,12 +161748,12 @@ Let `P` be the cancellation slot associated with the current coroutine's [link a asio::awaitable my_coroutine() - { - co_await asio::this_coro::reset_cancellation_state( - asio::enable_partial_cancellation()); + { + co_await asio::this_coro::reset_cancellation_state( + asio::enable_partial_cancellation()); - // ... - } + // ... + } @@ -162355,7 +161761,8 @@ Let `P` be the cancellation slot associated with the current coroutine's [link a [heading Remarks] -The cancellation state is shared by all coroutines in the same "thread of execution" that was created using [link asio.reference.co_spawn `co_spawn`]. +The cancellation state is shared by all coroutines in the same "thread +of execution" that was created using [link asio.reference.co_spawn `co_spawn`]. @@ -162386,13 +161793,13 @@ Let `P` be the cancellation slot associated with the current coroutine's [link a asio::awaitable my_coroutine() - { - co_await asio::this_coro::reset_cancellation_state( - asio::enable_partial_cancellation(), - asio::disable_cancellation()); + { + co_await asio::this_coro::reset_cancellation_state( + asio::enable_partial_cancellation(), + asio::disable_cancellation()); - // ... - } + // ... + } @@ -162400,7 +161807,8 @@ Let `P` be the cancellation slot associated with the current coroutine's [link a [heading Remarks] -The cancellation state is shared by all coroutines in the same "thread of execution" that was created using [link asio.reference.co_spawn `co_spawn`]. +The cancellation state is shared by all coroutines in the same "thread +of execution" that was created using [link asio.reference.co_spawn `co_spawn`]. @@ -162447,12 +161855,12 @@ Returns an awaitable object that may be used to determine whether the coroutine asio::awaitable my_coroutine() - { - if (co_await asio::this_coro::throw_if_cancelled) - // ... + { + if (co_await asio::this_coro::throw_if_cancelled) + // ... - // ... - } + // ... + } @@ -162480,11 +161888,11 @@ Returns an awaitable object that may be used to specify whether the coroutine th asio::awaitable my_coroutine() - { - co_await asio::this_coro::throw_if_cancelled(false); + { + co_await asio::this_coro::throw_if_cancelled(false); - // ... - } + // ... + } @@ -162542,16 +161950,16 @@ The [link asio.reference.thread `thread`] class implements the smallest possible [heading Example] -A typical use of [link asio.reference.thread `thread`] would be to launch a thread to run an io\_context's event processing loop: +A typical use of [link asio.reference.thread `thread`] would be to launch a thread to run an [link asio.reference.io_context `io_context`]'s event processing loop: asio::io_context io_context; - // ... - asio::thread t(boost::bind(&asio::io_context::run, &io_context)); - // ... - t.join(); + // ... + asio::thread t(boost::bind(&asio::io_context::run, &io_context)); + // ... + t.join(); @@ -162603,9 +162011,9 @@ This constructor creates a new thread that will execute the given function or fu [variablelist -[[f][The function or function object to be run in the thread. The function signature must be: +[[f][The function or function object to be run in the thread. The function signature must be: `` - void f(); + void f(); `` ]] @@ -162671,13 +162079,6 @@ A simple fixed-size thread pool. ] - [ - - [[link asio.reference.thread_pool.scheduler_type [*scheduler_type]]] - [Scheduler used to schedule receivers on a thread pool. ] - - ] - ] [heading Member Functions] @@ -162709,11 +162110,6 @@ A simple fixed-size thread pool. [Notify the execution_context of a fork-related event. ] ] - [ - [[link asio.reference.thread_pool.scheduler [*scheduler]]] - [Obtains the scheduler associated with the pool. ] - ] - [ [[link asio.reference.thread_pool.stop [*stop]]] [Stops the threads. ] @@ -162754,32 +162150,6 @@ A simple fixed-size thread pool. ] -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.thread_pool.add_service [*add_service]]] - [(Deprecated: Use make_service().) Add a service object to the execution_context. ] - ] - - [ - [[link asio.reference.thread_pool.has_service [*has_service]]] - [Determine if an execution_context contains a specified service type. ] - ] - - [ - [[link asio.reference.thread_pool.make_service [*make_service]]] - [Creates a service object and adds it to the execution_context. ] - ] - - [ - [[link asio.reference.thread_pool.use_service [*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. @@ -162794,83 +162164,28 @@ 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(); + ... + // 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, + []() + { + ... + }); -[heading Requirements] - -['Header: ][^asio/thread_pool.hpp] - -['Convenience header: ][^asio.hpp] - - -[section:add_service thread_pool::add_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.thread_pool.add_service..add_service..thread_pool] -(Deprecated: Use `make_service()`.) Add a service object to the [link asio.reference.execution_context `execution_context`]. - - - template< - typename ``[link asio.reference.Service Service]``> - friend void add_service( - execution_context & e, - Service * svc); - - -This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: -`` - delete static_cast(svc) -`` -]] - -] - - -[heading Exceptions] - + // Wait for all tasks in the pool to complete. + pool.join(); -[variablelist - -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] - -[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] - -] @@ -162881,10 +162196,6 @@ This function is used to add a service to the [link asio.reference.execution_con ['Convenience header: ][^asio.hpp] -[endsect] - - - [section:attach thread_pool::attach] [indexterm2 asio.indexterm.thread_pool.attach..attach..thread_pool] @@ -162948,33 +162259,6 @@ Executor used to submit functions to a thread pool. typedef basic_executor_type< std::allocator< void >, 0 > executor_type; -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.index_type [*index_type]]] - [The bulk execution index type. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.sender_type [*sender_type]]] - [(Deprecated.) The sender type, when this type is used as a scheduler. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.shape_type [*shape_type]]] - [The bulk execution shape type. ] - - ] - -] - [heading Member Functions] [table [[Name][Description]] @@ -162986,16 +162270,6 @@ Executor used to submit functions to a thread pool. Move constructor. ] ] - [ - [[link asio.reference.thread_pool__basic_executor_type.bulk_execute [*bulk_execute]]] - [(Deprecated.) Bulk execution function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.connect [*connect]]] - [(Deprecated.) Connect function. ] - ] - [ [[link asio.reference.thread_pool__basic_executor_type.context [*context]]] [Obtain the underlying execution context. ] @@ -163053,448 +162327,7 @@ Executor used to submit functions to a thread pool. [ [[link asio.reference.thread_pool__basic_executor_type.query__static [*query]] [static]] - [(Deprecated.) Query the current value of the bulk_guarantee property. - [hr] - Query the current value of the mapping property. - [hr] - Query the current value of the outstanding_work property. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.require [*require]]] - [Obtain an executor with the blocking.possibly property. - [hr] - Obtain an executor with the blocking.always property. - [hr] - Obtain an executor with the blocking.never property. - [hr] - Obtain an executor with the relationship.fork property. - [hr] - Obtain an executor with the relationship.continuation property. - [hr] - Obtain an executor with the outstanding_work.tracked property. - [hr] - Obtain an executor with the outstanding_work.untracked property. - [hr] - Obtain an executor with the specified allocator property. - [hr] - Obtain an executor with the default allocator property. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.running_in_this_thread [*running_in_this_thread]]] - [Determine whether the thread pool is running in the current thread. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.schedule [*schedule]]] - [(Deprecated.) Schedule function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type._basic_executor_type [*~basic_executor_type]] [destructor]] - [Destructor. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.thread_pool__basic_executor_type.operator_not__eq_ [*operator!=]]] - [Compare two executors for inequality. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.operator_eq__eq_ [*operator==]]] - [Compare two executors for equality. ] - ] - -] - - -[heading Requirements] - -['Header: ][^asio/thread_pool.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:fork_event thread_pool::fork_event] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.thread_pool.fork_event..fork_event..thread_pool] -Fork-related event notifications. - - enum fork_event - -[indexterm2 asio.indexterm.thread_pool.fork_event.fork_prepare..fork_prepare..thread_pool] -[indexterm2 asio.indexterm.thread_pool.fork_event.fork_parent..fork_parent..thread_pool] -[indexterm2 asio.indexterm.thread_pool.fork_event.fork_child..fork_child..thread_pool] - -[heading Values] -[variablelist - - [ - [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. ] - ] - -] - - - -[endsect] - - - -[section:get_executor thread_pool::get_executor] - -[indexterm2 asio.indexterm.thread_pool.get_executor..get_executor..thread_pool] -Obtains the executor associated with the pool. - - - executor_type get_executor(); - - - -[endsect] - - - -[section:has_service thread_pool::has_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.thread_pool.has_service..has_service..thread_pool] -Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. - - - template< - typename ``[link asio.reference.Service Service]``> - friend bool has_service( - execution_context & e); - - -This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -] - - -[heading Return Value] - -A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. - - - -[heading Requirements] - -['Header: ][^asio/thread_pool.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:join thread_pool::join] - -[indexterm2 asio.indexterm.thread_pool.join..join..thread_pool] -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. - - -[endsect] - - - -[section:make_service thread_pool::make_service] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.thread_pool.make_service..make_service..thread_pool] -Creates a service object and adds it to the [link asio.reference.execution_context `execution_context`]. - - - template< - typename ``[link asio.reference.Service Service]``, - typename... Args> - friend Service & make_service( - execution_context & e, - Args &&... args); - - -This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. - - -[heading Parameters] - - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] - -[[args][Zero or more arguments to be passed to the service constructor.]] - -] - - -[heading Exceptions] - - -[variablelist - -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`]. ]] - -] - - - -[heading Requirements] - -['Header: ][^asio/thread_pool.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:notify_fork thread_pool::notify_fork] - - -['Inherited from execution_context.] - -[indexterm2 asio.indexterm.thread_pool.notify_fork..notify_fork..thread_pool] -Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. - - - void notify_fork( - fork_event event); - - -This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `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 [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. - - -[heading Parameters] - - -[variablelist - -[[event][A fork-related event.]] - -] - - -[heading Exceptions] - - -[variablelist - -[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.execution_context `execution_context`] object should no longer be used and should be destroyed.]] - -] - - -[heading 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); - } - - - - - -[heading Remarks] - -For each service object `svc` in the [link asio.reference.execution_context `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. - - - - -[endsect] - - - -[section:scheduler thread_pool::scheduler] - -[indexterm2 asio.indexterm.thread_pool.scheduler..scheduler..thread_pool] -Obtains the scheduler associated with the pool. - - - scheduler_type scheduler(); - - - -[endsect] - - - -[section:scheduler_type thread_pool::scheduler_type] - -[indexterm2 asio.indexterm.thread_pool.scheduler_type..scheduler_type..thread_pool] -Scheduler used to schedule receivers on a thread pool. - - - typedef basic_executor_type< std::allocator< void >, 0 > scheduler_type; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.index_type [*index_type]]] - [The bulk execution index type. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.sender_type [*sender_type]]] - [(Deprecated.) The sender type, when this type is used as a scheduler. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.shape_type [*shape_type]]] - [The bulk execution shape type. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.thread_pool__basic_executor_type.basic_executor_type [*basic_executor_type]] [constructor]] - [Copy constructor. - [hr] - Move constructor. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.bulk_execute [*bulk_execute]]] - [(Deprecated.) Bulk execution function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.connect [*connect]]] - [(Deprecated.) Connect function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.context [*context]]] - [Obtain the underlying execution context. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.defer [*defer]]] - [Request the thread pool to invoke the given function object. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.dispatch [*dispatch]]] - [Request the thread pool to invoke the given function object. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.execute [*execute]]] - [Execution function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.on_work_finished [*on_work_finished]]] - [Inform the thread pool that some work is no longer outstanding. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.on_work_started [*on_work_started]]] - [Inform the thread pool that it has some outstanding work to do. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.operator_eq_ [*operator=]]] - [Assignment operator. - [hr] - Move assignment operator. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.post [*post]]] - [Request the thread pool to invoke the given function object. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.query [*query]]] - [Query the current value of the context property. - [hr] - Query the current value of the blocking property. - [hr] - Query the current value of the relationship property. - [hr] - Query the current value of the allocator property. - [hr] - Query the occupancy (recommended number of work items) for the pool. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.query__static [*query]] [static]] - [(Deprecated.) Query the current value of the bulk_guarantee property. - [hr] - Query the current value of the mapping property. + [Query the current value of the mapping property. [hr] Query the current value of the outstanding_work property. ] ] @@ -163525,11 +162358,6 @@ Scheduler used to schedule receivers on a thread pool. [Determine whether the thread pool is running in the current thread. ] ] - [ - [[link asio.reference.thread_pool__basic_executor_type.schedule [*schedule]]] - [(Deprecated.) Schedule function. ] - ] - [ [[link asio.reference.thread_pool__basic_executor_type._basic_executor_type [*~basic_executor_type]] [destructor]] [Destructor. ] @@ -163565,23 +162393,39 @@ Scheduler used to schedule receivers on a thread pool. -[section:shutdown thread_pool::shutdown] +[section:fork_event thread_pool::fork_event] ['Inherited from execution_context.] -[indexterm2 asio.indexterm.thread_pool.shutdown..shutdown..thread_pool] -Shuts down all services in the context. +[indexterm2 asio.indexterm.thread_pool.fork_event..fork_event..thread_pool] +Fork-related event notifications. + enum fork_event - void shutdown(); +[indexterm2 asio.indexterm.thread_pool.fork_event.fork_prepare..fork_prepare..thread_pool] +[indexterm2 asio.indexterm.thread_pool.fork_event.fork_parent..fork_parent..thread_pool] +[indexterm2 asio.indexterm.thread_pool.fork_event.fork_child..fork_child..thread_pool] +[heading Values] +[variablelist -This function is implemented as follows: + [ + [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. ] + ] -* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown()`. + [ + [fork_child] + [Notify the context that the process has forked and is the child. ] + ] +] @@ -163589,177 +162433,185 @@ This function is implemented as follows: -[section:stop thread_pool::stop] - -[indexterm2 asio.indexterm.thread_pool.stop..stop..thread_pool] -Stops the threads. +[section:get_executor thread_pool::get_executor] +[indexterm2 asio.indexterm.thread_pool.get_executor..get_executor..thread_pool] +Obtains the executor associated with the pool. - void stop(); + executor_type get_executor(); -This function stops the threads as soon as possible. As a result of calling `stop()`, pending function objects may be never be invoked. [endsect] -[section:thread_pool thread_pool::thread_pool] -[indexterm2 asio.indexterm.thread_pool.thread_pool..thread_pool..thread_pool] -Constructs a pool with an automatically determined number of threads. +[section:join thread_pool::join] +[indexterm2 asio.indexterm.thread_pool.join..join..thread_pool] +Joins the threads. - ``[link asio.reference.thread_pool.thread_pool.overload1 thread_pool]``(); - `` [''''»''' [link asio.reference.thread_pool.thread_pool.overload1 more...]]`` + void join(); -Constructs a pool with a specified number of threads. +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. - ``[link asio.reference.thread_pool.thread_pool.overload2 thread_pool]``( - std::size_t num_threads); - `` [''''»''' [link asio.reference.thread_pool.thread_pool.overload2 more...]]`` +[endsect] -[section:overload1 thread_pool::thread_pool (1 of 2 overloads)] -Constructs a pool with an automatically determined number of threads. +[section:notify_fork thread_pool::notify_fork] - thread_pool(); +['Inherited from execution_context.] +[indexterm2 asio.indexterm.thread_pool.notify_fork..notify_fork..thread_pool] +Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. -[endsect] + void notify_fork( + fork_event event); +This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `execution_context`], and the services it contains, to perform any necessary housekeeping to ensure correct operation following a fork. -[section:overload2 thread_pool::thread_pool (2 of 2 overloads)] +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the [link asio.reference.execution_context `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 [link asio.reference.execution_context `execution_context`] or its derived class. -Constructs a pool with a specified number of threads. +[heading Parameters] + +[variablelist + +[[event][A fork-related event.]] - thread_pool( - std::size_t num_threads); +] +[heading Exceptions] + -[endsect] +[variablelist + +[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.execution_context `execution_context`] object should no longer be used and should be destroyed.]] +] -[endsect] -[section:use_service thread_pool::use_service] +[heading Example] + +The following code illustrates how to incorporate the `notify_fork()` function: -[indexterm2 asio.indexterm.thread_pool.use_service..use_service..thread_pool] -Obtain the service object corresponding to the given type. + 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); + } - template< - typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.thread_pool.use_service.overload1 use_service]``( - execution_context & e); - `` [''''»''' [link asio.reference.thread_pool.use_service.overload1 more...]]`` - template< - typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.thread_pool.use_service.overload2 use_service]``( - io_context & ioc); - `` [''''»''' [link asio.reference.thread_pool.use_service.overload2 more...]]`` -[section:overload1 thread_pool::use_service (1 of 2 overloads)] +[heading Remarks] + +For each service object `svc` in the [link asio.reference.execution_context `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. + + + + +[endsect] + + + +[section:shutdown thread_pool::shutdown] ['Inherited from execution_context.] +[indexterm2 asio.indexterm.thread_pool.shutdown..shutdown..thread_pool] +Shuts down all services in the context. -Obtain the service object corresponding to the given type. + void shutdown(); - template< - typename ``[link asio.reference.Service Service]``> - friend Service & use_service( - execution_context & e); +This function is implemented as follows: -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 [link asio.reference.execution_context `execution_context`] will create a new instance of the service. +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown()`. -[heading Parameters] - -[variablelist - -[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] -] +[endsect] -[heading Return Value] - -The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. +[section:stop thread_pool::stop] -[heading Requirements] +[indexterm2 asio.indexterm.thread_pool.stop..stop..thread_pool] +Stops the threads. -['Header: ][^asio/thread_pool.hpp] -['Convenience header: ][^asio.hpp] + 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. [endsect] +[section:thread_pool thread_pool::thread_pool] -[section:overload2 thread_pool::use_service (2 of 2 overloads)] +[indexterm2 asio.indexterm.thread_pool.thread_pool..thread_pool..thread_pool] +Constructs a pool with an automatically determined number of threads. -['Inherited from execution_context.] + ``[link asio.reference.thread_pool.thread_pool.overload1 thread_pool]``(); + `` [''''»''' [link asio.reference.thread_pool.thread_pool.overload1 more...]]`` -Obtain the service object corresponding to the given type. +Constructs a pool with a specified number of threads. - template< - typename ``[link asio.reference.Service Service]``> - friend Service & use_service( - io_context & ioc); + ``[link asio.reference.thread_pool.thread_pool.overload2 thread_pool]``( + std::size_t num_threads); + `` [''''»''' [link asio.reference.thread_pool.thread_pool.overload2 more...]]`` -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 [link asio.reference.io_context `io_context`] will create a new instance of the service. +[section:overload1 thread_pool::thread_pool (1 of 2 overloads)] -[heading Parameters] - +Constructs a pool with an automatically determined number of threads. -[variablelist - -[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] -] + thread_pool(); -[heading Return Value] - -The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. +[endsect] -[heading Remarks] - -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. +[section:overload2 thread_pool::thread_pool (2 of 2 overloads)] -[heading Requirements] -['Header: ][^asio/thread_pool.hpp] +Constructs a pool with a specified number of threads. + + + thread_pool( + std::size_t num_threads); -['Convenience header: ][^asio.hpp] [endsect] @@ -163816,33 +162668,6 @@ Executor implementation type used to submit functions to a thread pool. class basic_executor_type -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.index_type [*index_type]]] - [The bulk execution index type. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.sender_type [*sender_type]]] - [(Deprecated.) The sender type, when this type is used as a scheduler. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.shape_type [*shape_type]]] - [The bulk execution shape type. ] - - ] - -] - [heading Member Functions] [table [[Name][Description]] @@ -163854,16 +162679,6 @@ Executor implementation type used to submit functions to a thread pool. Move constructor. ] ] - [ - [[link asio.reference.thread_pool__basic_executor_type.bulk_execute [*bulk_execute]]] - [(Deprecated.) Bulk execution function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.connect [*connect]]] - [(Deprecated.) Connect function. ] - ] - [ [[link asio.reference.thread_pool__basic_executor_type.context [*context]]] [Obtain the underlying execution context. ] @@ -163921,9 +162736,7 @@ Executor implementation type used to submit functions to a thread pool. [ [[link asio.reference.thread_pool__basic_executor_type.query__static [*query]] [static]] - [(Deprecated.) Query the current value of the bulk_guarantee property. - [hr] - Query the current value of the mapping property. + [Query the current value of the mapping property. [hr] Query the current value of the outstanding_work property. ] ] @@ -163954,11 +162767,6 @@ Executor implementation type used to submit functions to a thread pool. [Determine whether the thread pool is running in the current thread. ] ] - [ - [[link asio.reference.thread_pool__basic_executor_type.schedule [*schedule]]] - [(Deprecated.) Schedule function. ] - ] - [ [[link asio.reference.thread_pool__basic_executor_type._basic_executor_type [*~basic_executor_type]] [destructor]] [Destructor. ] @@ -164039,50 +162847,6 @@ Move constructor. [endsect] -[section:bulk_execute thread_pool::basic_executor_type::bulk_execute] - -[indexterm2 asio.indexterm.thread_pool__basic_executor_type.bulk_execute..bulk_execute..thread_pool::basic_executor_type] -(Deprecated.) Bulk execution function. - - - template< - typename Function> - void bulk_execute( - Function && f, - std::size_t n) const; - - - -[endsect] - - - -[section:connect thread_pool::basic_executor_type::connect] - -[indexterm2 asio.indexterm.thread_pool__basic_executor_type.connect..connect..thread_pool::basic_executor_type] -(Deprecated.) Connect function. - - - template< - typename ``[link asio.reference.Receiver Receiver]``> - unspecified connect( - Receiver && r) const; - - -Do not call this function directly. It is intended for use with the [link asio.reference.execution__connect `execution::connect`] customisation point. - - -[heading Return Value] - -An object of an unspecified type that satisfies the `operation_state` concept. - - - - -[endsect] - - - [section:context thread_pool::basic_executor_type::context] [indexterm2 asio.indexterm.thread_pool__basic_executor_type.context..context..thread_pool::basic_executor_type] @@ -164121,9 +162885,9 @@ If the current thread belongs to the thread pool, `defer()` will delay schedulin [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -164160,9 +162924,9 @@ This function is used to ask the thread pool to execute the given function objec [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -164194,27 +162958,6 @@ Execution function. -[section:index_type thread_pool::basic_executor_type::index_type] - -[indexterm2 asio.indexterm.thread_pool__basic_executor_type.index_type..index_type..thread_pool::basic_executor_type] -The bulk execution index type. - - - typedef std::size_t index_type; - - - -[heading Requirements] - -['Header: ][^asio/thread_pool.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:on_work_finished thread_pool::basic_executor_type::on_work_finished] [indexterm2 asio.indexterm.thread_pool__basic_executor_type.on_work_finished..on_work_finished..thread_pool::basic_executor_type] @@ -164253,7 +162996,7 @@ This function is used to inform the thread pool that some work has begun. This e Compare two executors for inequality. - friend bool operator!=( + bool operator!=( const basic_executor_type & a, const basic_executor_type & b); @@ -164327,7 +163070,7 @@ Move assignment operator. Compare two executors for equality. - friend bool operator==( + bool operator==( const basic_executor_type & a, const basic_executor_type & b); @@ -164367,9 +163110,9 @@ This function is used to ask the thread pool to execute the given function objec [variablelist -[[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: +[[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(); + void function(); `` ]] @@ -164447,8 +163190,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - asio::thread_pool& pool = asio::query( - ex, asio::execution::context); + asio::thread_pool& pool = asio::query( + ex, asio::execution::context); @@ -164473,9 +163216,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - if (asio::query(ex, asio::execution::blocking) - == asio::execution::blocking.always) - ... + if (asio::query(ex, asio::execution::blocking) + == asio::execution::blocking.always) + ... @@ -164500,9 +163243,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - if (asio::query(ex, asio::execution::relationship) - == asio::execution::relationship.continuation) - ... + if (asio::query(ex, asio::execution::relationship) + == asio::execution::relationship.continuation) + ... @@ -164529,8 +163272,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - auto alloc = asio::query(ex, - asio::execution::allocator); + auto alloc = asio::query(ex, + asio::execution::allocator); @@ -164555,8 +163298,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - auto alloc = asio::query(ex, - asio::execution::allocator); + auto alloc = asio::query(ex, + asio::execution::allocator); @@ -164581,8 +163324,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - std::size_t occupancy = asio::query( - ex, asio::execution::occupancy); + std::size_t occupancy = asio::query( + ex, asio::execution::occupancy); @@ -164596,58 +163339,23 @@ For example: [section:query__static thread_pool::basic_executor_type::query] [indexterm2 asio.indexterm.thread_pool__basic_executor_type.query__static..query..thread_pool::basic_executor_type] -(Deprecated.) Query the current value of the `bulk_guarantee` property. - - - static constexpr execution::bulk_guarantee_t ``[link asio.reference.thread_pool__basic_executor_type.query__static.overload1 query]``( - execution::bulk_guarantee_t ); - `` [''''»''' [link asio.reference.thread_pool__basic_executor_type.query__static.overload1 more...]]`` - - Query the current value of the `mapping` property. - static constexpr execution::mapping_t ``[link asio.reference.thread_pool__basic_executor_type.query__static.overload2 query]``( + static constexpr execution::mapping_t ``[link asio.reference.thread_pool__basic_executor_type.query__static.overload1 query]``( execution::mapping_t ); - `` [''''»''' [link asio.reference.thread_pool__basic_executor_type.query__static.overload2 more...]]`` + `` [''''»''' [link asio.reference.thread_pool__basic_executor_type.query__static.overload1 more...]]`` Query the current value of the `outstanding_work` property. - static constexpr execution::outstanding_work_t ``[link asio.reference.thread_pool__basic_executor_type.query__static.overload3 query]``( + static constexpr execution::outstanding_work_t ``[link asio.reference.thread_pool__basic_executor_type.query__static.overload2 query]``( execution::outstanding_work_t ); - `` [''''»''' [link asio.reference.thread_pool__basic_executor_type.query__static.overload3 more...]]`` - - -[section:overload1 thread_pool::basic_executor_type::query (1 of 3 overloads)] - - -(Deprecated.) 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 [link asio.reference.query `query`] customisation point. - -For example: - - auto ex = my_thread_pool.executor(); - if (asio::query(ex, asio::execution::bulk_guarantee) - == asio::execution::bulk_guarantee.parallel) - ... - - - - - -[endsect] - + `` [''''»''' [link asio.reference.thread_pool__basic_executor_type.query__static.overload2 more...]]`` -[section:overload2 thread_pool::basic_executor_type::query (2 of 3 overloads)] +[section:overload1 thread_pool::basic_executor_type::query (1 of 2 overloads)] Query the current value of the `mapping` property. @@ -164662,9 +163370,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - if (asio::query(ex, asio::execution::mapping) - == asio::execution::mapping.thread) - ... + if (asio::query(ex, asio::execution::mapping) + == asio::execution::mapping.thread) + ... @@ -164674,7 +163382,7 @@ For example: -[section:overload3 thread_pool::basic_executor_type::query (3 of 3 overloads)] +[section:overload2 thread_pool::basic_executor_type::query (2 of 2 overloads)] Query the current value of the `outstanding_work` property. @@ -164689,9 +163397,9 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex = my_thread_pool.executor(); - if (asio::query(ex, asio::execution::outstanding_work) - == asio::execution::outstanding_work.tracked) - ... + if (asio::query(ex, asio::execution::outstanding_work) + == asio::execution::outstanding_work.tracked) + ... @@ -164794,8 +163502,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::blocking.possibly); + auto ex2 = asio::require(ex1, + asio::execution::blocking.possibly); @@ -164820,8 +163528,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::blocking.always); + auto ex2 = asio::require(ex1, + asio::execution::blocking.always); @@ -164846,8 +163554,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::blocking.never); + auto ex2 = asio::require(ex1, + asio::execution::blocking.never); @@ -164872,8 +163580,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::relationship.fork); + auto ex2 = asio::require(ex1, + asio::execution::relationship.fork); @@ -164898,8 +163606,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::relationship.continuation); + auto ex2 = asio::require(ex1, + asio::execution::relationship.continuation); @@ -164924,8 +163632,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::outstanding_work.tracked); + auto ex2 = asio::require(ex1, + asio::execution::outstanding_work.tracked); @@ -164950,8 +163658,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::outstanding_work.untracked); + auto ex2 = asio::require(ex1, + asio::execution::outstanding_work.untracked); @@ -164978,8 +163686,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::allocator(my_allocator)); + auto ex2 = asio::require(ex1, + asio::execution::allocator(my_allocator)); @@ -165004,8 +163712,8 @@ Do not call this function directly. It is intended for use with the [link asio.r For example: auto ex1 = my_thread_pool.executor(); - auto ex2 = asio::require(ex1, - asio::execution::allocator); + auto ex2 = asio::require(ex1, + asio::execution::allocator); @@ -165038,22 +163746,13 @@ Determine whether the thread pool is running in the current thread. -[section:schedule thread_pool::basic_executor_type::schedule] - -[indexterm2 asio.indexterm.thread_pool__basic_executor_type.schedule..schedule..thread_pool::basic_executor_type] -(Deprecated.) Schedule function. - - - sender_type schedule() const; - - -Do not call this function directly. It is intended for use with the [link asio.reference.execution__schedule `execution::schedule`] customisation point. +[section:_basic_executor_type thread_pool::basic_executor_type::~basic_executor_type] +[indexterm2 asio.indexterm.thread_pool__basic_executor_type._basic_executor_type..~basic_executor_type..thread_pool::basic_executor_type] +Destructor. -[heading Return Value] - -An object that satisfies the sender concept. + ~basic_executor_type(); @@ -165061,228 +163760,28 @@ An object that satisfies the sender concept. -[section:sender_type thread_pool::basic_executor_type::sender_type] - -[indexterm2 asio.indexterm.thread_pool__basic_executor_type.sender_type..sender_type..thread_pool::basic_executor_type] -(Deprecated.) The sender type, when this type is used as a scheduler. - - - typedef basic_executor_type sender_type; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.index_type [*index_type]]] - [The bulk execution index type. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.sender_type [*sender_type]]] - [(Deprecated.) The sender type, when this type is used as a scheduler. ] - - ] - - [ - - [[link asio.reference.thread_pool__basic_executor_type.shape_type [*shape_type]]] - [The bulk execution shape type. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.thread_pool__basic_executor_type.basic_executor_type [*basic_executor_type]] [constructor]] - [Copy constructor. - [hr] - Move constructor. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.bulk_execute [*bulk_execute]]] - [(Deprecated.) Bulk execution function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.connect [*connect]]] - [(Deprecated.) Connect function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.context [*context]]] - [Obtain the underlying execution context. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.defer [*defer]]] - [Request the thread pool to invoke the given function object. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.dispatch [*dispatch]]] - [Request the thread pool to invoke the given function object. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.execute [*execute]]] - [Execution function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.on_work_finished [*on_work_finished]]] - [Inform the thread pool that some work is no longer outstanding. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.on_work_started [*on_work_started]]] - [Inform the thread pool that it has some outstanding work to do. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.operator_eq_ [*operator=]]] - [Assignment operator. - [hr] - Move assignment operator. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.post [*post]]] - [Request the thread pool to invoke the given function object. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.query [*query]]] - [Query the current value of the context property. - [hr] - Query the current value of the blocking property. - [hr] - Query the current value of the relationship property. - [hr] - Query the current value of the allocator property. - [hr] - Query the occupancy (recommended number of work items) for the pool. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.query__static [*query]] [static]] - [(Deprecated.) Query the current value of the bulk_guarantee property. - [hr] - Query the current value of the mapping property. - [hr] - Query the current value of the outstanding_work property. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.require [*require]]] - [Obtain an executor with the blocking.possibly property. - [hr] - Obtain an executor with the blocking.always property. - [hr] - Obtain an executor with the blocking.never property. - [hr] - Obtain an executor with the relationship.fork property. - [hr] - Obtain an executor with the relationship.continuation property. - [hr] - Obtain an executor with the outstanding_work.tracked property. - [hr] - Obtain an executor with the outstanding_work.untracked property. - [hr] - Obtain an executor with the specified allocator property. - [hr] - Obtain an executor with the default allocator property. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.running_in_this_thread [*running_in_this_thread]]] - [Determine whether the thread pool is running in the current thread. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.schedule [*schedule]]] - [(Deprecated.) Schedule function. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type._basic_executor_type [*~basic_executor_type]] [destructor]] - [Destructor. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.thread_pool__basic_executor_type.operator_not__eq_ [*operator!=]]] - [Compare two executors for inequality. ] - ] - - [ - [[link asio.reference.thread_pool__basic_executor_type.operator_eq__eq_ [*operator==]]] - [Compare two executors for equality. ] - ] - -] - - -[heading Requirements] - -['Header: ][^asio/thread_pool.hpp] - -['Convenience header: ][^asio.hpp] - - [endsect] +[section:time_traits time_traits] +[indexterm1 asio.indexterm.time_traits..time_traits] -[section:shape_type thread_pool::basic_executor_type::shape_type] -[indexterm2 asio.indexterm.thread_pool__basic_executor_type.shape_type..shape_type..thread_pool::basic_executor_type] -The bulk execution shape type. +Time traits suitable for use with the deadline timer. - typedef std::size_t shape_type; - + template< + typename Time> + struct time_traits [heading Requirements] -['Header: ][^asio/thread_pool.hpp] +['Header: ][^asio/time_traits.hpp] ['Convenience header: ][^asio.hpp] -[endsect] - - - -[section:_basic_executor_type thread_pool::basic_executor_type::~basic_executor_type] - -[indexterm2 asio.indexterm.thread_pool__basic_executor_type._basic_executor_type..~basic_executor_type..thread_pool::basic_executor_type] -Destructor. - - - ~basic_executor_type(); - - - -[endsect] - - - [endsect] [section:time_traits_lt__ptime__gt_ time_traits< boost::posix_time::ptime >] @@ -165494,19 +163993,19 @@ This function is used to create an object, of unspecified type, that meets Compl Reading until a buffer is full: - 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 - } + 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 + } @@ -165542,19 +164041,19 @@ This function is used to create an object, of unspecified type, that meets Compl Reading until a buffer is full or contains at least 64 bytes: - 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 - } + 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 + } @@ -165590,19 +164089,19 @@ This function is used to create an object, of unspecified type, that meets Compl Reading until a buffer is full or contains exactly 64 bytes: - 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 - } + 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 + } @@ -165659,6 +164158,13 @@ A [link asio.overview.model.completion_tokens completion token] that represents [table [[Name][Description]] + [ + + [[link asio.reference.use_awaitable_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use use_awaitable_t as its default completion token type. ] + + ] + [ [[link asio.reference.use_awaitable_t__executor_with_default [*executor_with_default]]] @@ -165691,10 +164197,10 @@ The `use_awaitable_t` class, with its value `use_awaitable`, is used to represen awaitable my_coroutine() - { - std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable); - ... - } + { + std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable); + ... + } @@ -165716,7 +164222,7 @@ Function helper to adapt an I/O object to use `use_awaitable_t` as its default c template< typename T> - static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + static decay_t< T >::template rebind_executor< executor_with_default< typenamedecay_t< T >::executor_type > >::other as_default_on( T && object); @@ -165724,6 +164230,51 @@ Function helper to adapt an I/O object to use `use_awaitable_t` as its default c [endsect] + +[section:as_default_on_t use_awaitable_t::as_default_on_t] + +[indexterm2 asio.indexterm.use_awaitable_t.as_default_on_t..as_default_on_t..use_awaitable_t] +Type alias to adapt an I/O object to use `use_awaitable_t` as its default completion token type. + + + typedef typename T::template rebind_executor< executor_with_default< typename T::executor_type > >::other as_default_on_t; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify use_awaitable_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.use_awaitable_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/use_awaitable.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:use_awaitable_t use_awaitable_t::use_awaitable_t] [indexterm2 asio.indexterm.use_awaitable_t.use_awaitable_t..use_awaitable_t..use_awaitable_t] @@ -165789,7 +164340,8 @@ Adapts an executor to add the `use_awaitable_t` completion token as the default. template< typename ``[link asio.reference.Executor1 InnerExecutor]``> - struct executor_with_default + struct executor_with_default : + public InnerExecutor [heading Types] @@ -165836,6 +164388,13 @@ Specify `use_awaitable_t` as the default completion token type. [table [[Name][Description]] + [ + + [[link asio.reference.use_awaitable_t.as_default_on_t [*as_default_on_t]]] + [Type alias to adapt an I/O object to use use_awaitable_t as its default completion token type. ] + + ] + [ [[link asio.reference.use_awaitable_t__executor_with_default [*executor_with_default]]] @@ -165868,10 +164427,10 @@ The `use_awaitable_t` class, with its value `use_awaitable`, is used to represen awaitable my_coroutine() - { - std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable); - ... - } + { + std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable); + ... + } @@ -165900,7 +164459,7 @@ Construct the adapted executor from the inner executor type. typename ``[link asio.reference.Executor1 InnerExecutor1]``> executor_with_default( const InnerExecutor1 & ex, - typename constraint< conditional< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::type::value >::type = 0); + constraint_t< conditional_t< !is_same< InnerExecutor1, executor_with_default >::value, is_convertible< InnerExecutor1, InnerExecutor >, false_type >::value > = 0); @@ -165970,7 +164529,9 @@ A [link asio.overview.model.completion_tokens completion token] type that causes [ [[link asio.reference.use_future_t.operator_lp__rp_ [*operator()]]] - [Wrap a function object in a packaged task. ] + [Wrap a function object in a packaged task. + [hr] + ] ] [ @@ -165996,13 +164557,13 @@ The [link asio.reference.use_future_t `use_future_t`] class is a completion toke - std::future my_future - = my_socket.async_read_some(my_buffer, asio::use_future); + std::future 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 [link asio.reference.error_code `error_code`] indicating failure, it is converted into a [link asio.reference.system_error `system_error`] and passed back to the caller via the 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. [heading Requirements] @@ -166045,10 +164606,30 @@ Obtain allocator. [endsect] - [section:operator_lp__rp_ use_future_t::operator()] [indexterm2 asio.indexterm.use_future_t.operator_lp__rp_..operator()..use_future_t] +Wrap a function object in a packaged task. + + + template< + typename Function> + unspecified ``[link asio.reference.use_future_t.operator_lp__rp_.overload1 operator()]``( + Function && f) const; + `` [''''»''' [link asio.reference.use_future_t.operator_lp__rp_.overload1 more...]]`` + + + + template< + typename Function> + detail::packaged_token< decay_t< Function >, Allocator > ``[link asio.reference.use_future_t.operator_lp__rp_.overload2 operator()]``( + Function && f) const; + `` [''''»''' [link asio.reference.use_future_t.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 use_future_t::operator() (1 of 2 overloads)] + + Wrap a function object in a packaged task. @@ -166068,13 +164649,13 @@ The `package` function is used to adapt a function object as a packaged task. Wh std::future 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(); + 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(); @@ -166084,6 +164665,23 @@ The `package` function is used to adapt a function object as a packaged task. Wh +[section:overload2 use_future_t::operator() (2 of 2 overloads)] + + + + template< + typename Function> + detail::packaged_token< decay_t< Function >, Allocator > operator()( + Function && f) const; + + + +[endsect] + + +[endsect] + + [section:operator_lb__rb_ use_future_t::operator\[\]] [indexterm2 asio.indexterm.use_future_t.operator_lb__rb_..operator\[\]..use_future_t] @@ -166183,7 +164781,7 @@ The [link asio.reference.uses_executor `uses_executor`] trait detects whether a 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 [link asio.reference.executor_arg_t `executor_arg_t`] and the second argument is convertible from type Executor. +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 [link asio.reference.executor_arg_t `executor_arg_t`] and the second argument is convertible from type Executor. [heading Requirements] @@ -166478,9 +165076,9 @@ Start an asynchronous wait on the object handle. template< - typename ``[link asio.reference.WaitToken WaitToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( - WaitToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + typename ``[link asio.reference.WaitToken WaitToken]`` = default_completion_token_t> + auto async_wait( + WaitToken && token = default_completion_token_t< executor_type >()); This function is be used to initiate an asynchronous wait against the object handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -166494,8 +165092,8 @@ This function is be used to initiate an asynchronous wait against the object han [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the wait completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error // Result of operation. - ); + const asio::error_code& error // Result of operation. + ); `` Regardless of whether the asynchronous operation completes immediately or not, the completion 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 [link asio.reference.post `post`].]] @@ -166506,7 +165104,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code) + void(asio::error_code) @@ -166531,7 +165129,7 @@ Construct an object handle without opening it. typename ExecutionContext> explicit ``[link asio.reference.windows__basic_object_handle.basic_object_handle.overload2 basic_object_handle]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_object_handle.basic_object_handle.overload2 more...]]`` @@ -166548,7 +165146,7 @@ Construct an object handle on an existing native handle. ``[link asio.reference.windows__basic_object_handle.basic_object_handle.overload4 basic_object_handle]``( ExecutionContext & context, const native_handle_type & native_handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.windows__basic_object_handle.basic_object_handle.overload4 more...]]`` @@ -166567,7 +165165,7 @@ Move-construct an object handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.windows__basic_object_handle.basic_object_handle.overload6 basic_object_handle]``( basic_object_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_object_handle.basic_object_handle.overload6 more...]]`` @@ -166610,7 +165208,7 @@ Construct an object handle without opening it. typename ExecutionContext> basic_object_handle( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates an object handle without opening it. @@ -166685,7 +165283,7 @@ Construct an object handle on an existing native handle. basic_object_handle( ExecutionContext & context, const native_handle_type & native_handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates an object handle object to hold an existing native handle. @@ -166763,7 +165361,7 @@ Move-construct an object handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> basic_object_handle( basic_object_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves an object handle from one object to another. @@ -167238,7 +165836,7 @@ Move-assign an object handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_object_handle & >::type ``[link asio.reference.windows__basic_object_handle.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_object_handle & > ``[link asio.reference.windows__basic_object_handle.operator_eq_.overload2 operator=]``( basic_object_handle< Executor1 > && other); `` [''''»''' [link asio.reference.windows__basic_object_handle.operator_eq_.overload2 more...]]`` @@ -167285,7 +165883,7 @@ Move-assign an object handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_object_handle & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_object_handle & > operator=( basic_object_handle< Executor1 > && other); @@ -167764,7 +166362,7 @@ Construct an overlapped handle without opening it. typename ExecutionContext> explicit ``[link asio.reference.windows__basic_overlapped_handle.basic_overlapped_handle.overload2 basic_overlapped_handle]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_overlapped_handle.basic_overlapped_handle.overload2 more...]]`` @@ -167781,7 +166379,7 @@ Construct an overlapped handle on an existing native handle. ``[link asio.reference.windows__basic_overlapped_handle.basic_overlapped_handle.overload4 basic_overlapped_handle]``( ExecutionContext & context, const native_handle_type & native_handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.windows__basic_overlapped_handle.basic_overlapped_handle.overload4 more...]]`` @@ -167800,7 +166398,7 @@ Move-construct an overlapped handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.windows__basic_overlapped_handle.basic_overlapped_handle.overload6 basic_overlapped_handle]``( basic_overlapped_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_overlapped_handle.basic_overlapped_handle.overload6 more...]]`` @@ -167843,7 +166441,7 @@ Construct an overlapped handle without opening it. typename ExecutionContext> basic_overlapped_handle( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates an overlapped handle without opening it. @@ -167918,7 +166516,7 @@ Construct an overlapped handle on an existing native handle. basic_overlapped_handle( ExecutionContext & context, const native_handle_type & native_handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates an overlapped handle object to hold an existing native handle. @@ -167996,7 +166594,7 @@ Move-construct an overlapped handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> basic_overlapped_handle( basic_overlapped_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a handle from one object to another. @@ -168477,7 +167075,7 @@ Move-assign an overlapped handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_overlapped_handle & >::type ``[link asio.reference.windows__basic_overlapped_handle.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_overlapped_handle & > ``[link asio.reference.windows__basic_overlapped_handle.operator_eq_.overload2 operator=]``( basic_overlapped_handle< Executor1 > && other); `` [''''»''' [link asio.reference.windows__basic_overlapped_handle.operator_eq_.overload2 more...]]`` @@ -168524,7 +167122,7 @@ Move-assign an overlapped handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_overlapped_handle & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_overlapped_handle & > operator=( basic_overlapped_handle< Executor1 > && other); @@ -168843,7 +167441,7 @@ Provides random-access handle functionality. template< typename ``[link asio.reference.Executor1 Executor]`` = any_io_executor> class basic_random_access_handle : - public windows::basic_overlapped_handle< Executor > + public windows::basic_overlapped_handle< any_io_executor > [heading Types] @@ -169046,11 +167644,11 @@ Start an asynchronous read at the specified offset. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some_at( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some_at( uint64_t offset, const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the random-access handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -169068,9 +167666,9 @@ This function is used to asynchronously read data from the random-access handle. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -169081,7 +167679,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -169096,7 +167694,7 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.async_read_some_at(42, asio::buffer(data, size), handler); + handle.async_read_some_at(42, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -169130,11 +167728,11 @@ Start an asynchronous write at the specified offset. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some_at( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some_at( uint64_t offset, const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the random-access handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -169152,9 +167750,9 @@ This function is used to asynchronously write data to the random-access handle. [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -169165,7 +167763,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -169180,7 +167778,7 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.async_write_some_at(42, asio::buffer(data, size), handler); + handle.async_write_some_at(42, asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -169219,7 +167817,7 @@ Construct a random-access handle without opening it. typename ExecutionContext> explicit ``[link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload2 basic_random_access_handle]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload2 more...]]`` @@ -169236,7 +167834,7 @@ Construct a random-access handle on an existing native handle. ``[link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload4 basic_random_access_handle]``( ExecutionContext & context, const native_handle_type & handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload4 more...]]`` @@ -169255,7 +167853,7 @@ Move-construct a random-access handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload6 basic_random_access_handle]``( basic_random_access_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload6 more...]]`` @@ -169298,7 +167896,7 @@ Construct a random-access handle without opening it. typename ExecutionContext> basic_random_access_handle( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a random-access handle without opening it. The handle needs to be opened or assigned before data can be written to or read from it. @@ -169373,7 +167971,7 @@ Construct a random-access handle on an existing native handle. basic_random_access_handle( ExecutionContext & context, const native_handle_type & handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a random-access handle object to hold an existing native handle. @@ -169451,7 +168049,7 @@ Move-construct a random-access handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> basic_random_access_handle( basic_random_access_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a random-access handle from one object to another. @@ -169962,7 +168560,7 @@ Move-assign a random-access handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_random_access_handle & >::type ``[link asio.reference.windows__basic_random_access_handle.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_random_access_handle & > ``[link asio.reference.windows__basic_random_access_handle.operator_eq_.overload2 operator=]``( basic_random_access_handle< Executor1 > && other); `` [''''»''' [link asio.reference.windows__basic_random_access_handle.operator_eq_.overload2 more...]]`` @@ -170009,7 +168607,7 @@ Move-assign a random-access handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_random_access_handle & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_random_access_handle & > operator=( basic_random_access_handle< Executor1 > && other); @@ -170112,7 +168710,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.read_some_at(42, asio::buffer(data, size)); + handle.read_some_at(42, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -170334,7 +168932,7 @@ The write\_some\_at operation may not write all of the data. Consider using the To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.write_some_at(42, asio::buffer(data, size)); + handle.write_some_at(42, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -170595,7 +169193,7 @@ Provides stream-oriented handle functionality. template< typename ``[link asio.reference.Executor1 Executor]`` = any_io_executor> class basic_stream_handle : - public windows::basic_overlapped_handle< Executor > + public windows::basic_overlapped_handle< any_io_executor > [heading Types] @@ -170799,10 +169397,10 @@ Start an asynchronous read. template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``, - typename ``[link asio.reference.ReadToken ReadToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_read_some( + typename ``[link asio.reference.ReadToken ReadToken]`` = default_completion_token_t> + auto async_read_some( const MutableBufferSequence & buffers, - ReadToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + ReadToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously read data from the stream handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -170818,9 +169416,9 @@ This function is used to asynchronously read data from the stream handle. It is [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the read completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes read. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -170831,7 +169429,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -170846,7 +169444,7 @@ The read operation may not read all of the requested number of bytes. Consider u To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.async_read_some(asio::buffer(data, size), handler); + handle.async_read_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -170880,10 +169478,10 @@ Start an asynchronous write. template< typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``, - typename ``[link asio.reference.WriteToken WriteToken]`` = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - ``[link asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_write_some( + typename ``[link asio.reference.WriteToken WriteToken]`` = default_completion_token_t> + auto async_write_some( const ConstBufferSequence & buffers, - WriteToken && token = ``[link asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + WriteToken && token = default_completion_token_t< executor_type >()); This function is used to asynchronously write data to the stream handle. It is an initiating function for an [link asio.overview.model.async_ops asynchronous operation], and always returns immediately. @@ -170899,9 +169497,9 @@ This function is used to asynchronously write data to the stream handle. It is a [[token][The [link asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler, which will be called when the write completes. Potential completion tokens include [link asio.reference.use_future `use_future`], [link asio.reference.use_awaitable `use_awaitable`], [link asio.reference.yield_context `yield_context`], or a function object with the correct completion signature. The function signature of the completion handler must be: `` void handler( - const asio::error_code& error, // Result of operation. - std::size_t bytes_transferred // Number of bytes written. - ); + 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 completion 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 [link asio.reference.post `post`].]] @@ -170912,7 +169510,7 @@ Regardless of whether the asynchronous operation completes immediately or not, t - void(asio::error_code, std::size_t) + void(asio::error_code, std::size_t) @@ -170927,7 +169525,7 @@ The write operation may not transmit all of the data to the peer. Consider using To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.async_write_some(asio::buffer(data, size), handler); + handle.async_write_some(asio::buffer(data, size), handler); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -170966,7 +169564,7 @@ Construct a stream handle without opening it. typename ExecutionContext> explicit ``[link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload2 basic_stream_handle]``( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload2 more...]]`` @@ -170983,7 +169581,7 @@ Construct a stream handle on an existing native handle. ``[link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload4 basic_stream_handle]``( ExecutionContext & context, const native_handle_type & handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload4 more...]]`` @@ -171002,7 +169600,7 @@ Move-construct a stream handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> ``[link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload6 basic_stream_handle]``( basic_stream_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); `` [''''»''' [link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload6 more...]]`` @@ -171045,7 +169643,7 @@ Construct a stream handle without opening it. typename ExecutionContext> basic_stream_handle( ExecutionContext & context, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value, defaulted_constraint > = defaulted_constraint()); This constructor creates a stream handle without opening it. The handle needs to be opened or assigned before data can be written to or read from it. @@ -171120,7 +169718,7 @@ Construct a stream handle on an existing native handle. basic_stream_handle( ExecutionContext & context, const native_handle_type & handle, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); This constructor creates a stream handle object to hold an existing native handle. @@ -171198,7 +169796,7 @@ Move-construct a stream handle from a handle of another executor type. typename ``[link asio.reference.Executor1 Executor1]``> basic_stream_handle( basic_stream_handle< Executor1 > && other, - typename constraint< is_convertible< Executor1, Executor >::value, defaulted_constraint >::type = defaulted_constraint()); + constraint_t< is_convertible< Executor1, Executor >::value, defaulted_constraint > = defaulted_constraint()); This constructor moves a stream handle from one object to another. @@ -171709,7 +170307,7 @@ Move-assign a stream handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_stream_handle & >::type ``[link asio.reference.windows__basic_stream_handle.operator_eq_.overload2 operator=]``( + constraint_t< is_convertible< Executor1, Executor >::value, basic_stream_handle & > ``[link asio.reference.windows__basic_stream_handle.operator_eq_.overload2 operator=]``( basic_stream_handle< Executor1 > && other); `` [''''»''' [link asio.reference.windows__basic_stream_handle.operator_eq_.overload2 more...]]`` @@ -171756,7 +170354,7 @@ Move-assign a stream handle from a handle of another executor type. template< typename ``[link asio.reference.Executor1 Executor1]``> - constraint< is_convertible< Executor1, Executor >::value, basic_stream_handle & >::type operator=( + constraint_t< is_convertible< Executor1, Executor >::value, basic_stream_handle & > operator=( basic_stream_handle< Executor1 > && other); @@ -171854,7 +170452,7 @@ The read\_some operation may not read all of the requested number of bytes. Cons To read into a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.read_some(asio::buffer(data, size)); + handle.read_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -172068,7 +170666,7 @@ The write\_some operation may not transmit all of the data to the peer. Consider To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - handle.write_some(asio::buffer(data, size)); + handle.write_some(asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -172744,7 +171342,7 @@ Construct an [link asio.reference.windows__overlapped_ptr `windows::overlapped_p explicit ``[link asio.reference.windows__overlapped_ptr.overlapped_ptr.overload2 overlapped_ptr]``( ExecutionContext & context, Handler && handler, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.windows__overlapped_ptr.overlapped_ptr.overload2 more...]]`` template< @@ -172753,7 +171351,7 @@ Construct an [link asio.reference.windows__overlapped_ptr `windows::overlapped_p explicit ``[link asio.reference.windows__overlapped_ptr.overlapped_ptr.overload3 overlapped_ptr]``( const Executor & ex, Handler && handler, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + constraint_t< execution::is_executor< Executor >::value||is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.windows__overlapped_ptr.overlapped_ptr.overload3 more...]]`` @@ -172783,7 +171381,7 @@ Construct an [link asio.reference.windows__overlapped_ptr `windows::overlapped_p overlapped_ptr( ExecutionContext & context, Handler && handler, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -172803,7 +171401,7 @@ Construct an [link asio.reference.windows__overlapped_ptr `windows::overlapped_p overlapped_ptr( const Executor & ex, Handler && handler, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + constraint_t< execution::is_executor< Executor >::value||is_executor< Executor >::value > = 0); @@ -172845,7 +171443,7 @@ Reset to contain the specified handler, freeing any current OVERLAPPED object. void ``[link asio.reference.windows__overlapped_ptr.reset.overload2 reset]``( ExecutionContext & context, Handler && handler, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link asio.reference.windows__overlapped_ptr.reset.overload2 more...]]`` template< @@ -172854,7 +171452,7 @@ Reset to contain the specified handler, freeing any current OVERLAPPED object. void ``[link asio.reference.windows__overlapped_ptr.reset.overload3 reset]``( const Executor & ex, Handler && handler, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + constraint_t< execution::is_executor< Executor >::value||is_executor< Executor >::value > = 0); `` [''''»''' [link asio.reference.windows__overlapped_ptr.reset.overload3 more...]]`` @@ -172884,7 +171482,7 @@ Reset to contain the specified handler, freeing any current OVERLAPPED object. void reset( ExecutionContext & context, Handler && handler, - typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); @@ -172904,7 +171502,7 @@ Reset to contain the specified handler, freeing any current OVERLAPPED object. void reset( const Executor & ex, Handler && handler, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + constraint_t< execution::is_executor< Executor >::value||is_executor< Executor >::value > = 0); @@ -173400,7 +171998,7 @@ Write all of the supplied data to a stream before returning. std::size_t ``[link asio.reference.write.overload1 write]``( SyncWriteStream & s, const ConstBufferSequence & buffers, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.write.overload1 more...]]`` template< @@ -173410,7 +172008,7 @@ Write all of the supplied data to a stream before returning. SyncWriteStream & s, const ConstBufferSequence & buffers, asio::error_code & ec, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.write.overload2 more...]]`` Write a certain amount of data to a stream before returning. @@ -173423,7 +172021,7 @@ Write a certain amount of data to a stream before returning. SyncWriteStream & s, const ConstBufferSequence & buffers, CompletionCondition completion_condition, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.write.overload3 more...]]`` template< @@ -173435,7 +172033,7 @@ Write a certain amount of data to a stream before returning. const ConstBufferSequence & buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 0); `` [''''»''' [link asio.reference.write.overload4 more...]]`` Write all of the supplied data to a stream before returning. @@ -173446,8 +172044,8 @@ Write all of the supplied data to a stream before returning. std::size_t ``[link asio.reference.write.overload5 write]``( SyncWriteStream & s, DynamicBuffer_v1 && buffers, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.write.overload5 more...]]`` template< @@ -173457,8 +172055,8 @@ Write all of the supplied data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v1 && buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.write.overload6 more...]]`` Write a certain amount of data to a stream before returning. @@ -173471,8 +172069,8 @@ Write a certain amount of data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.write.overload7 more...]]`` template< @@ -173484,8 +172082,8 @@ Write a certain amount of data to a stream before returning. DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 0); `` [''''»''' [link asio.reference.write.overload8 more...]]`` Write all of the supplied data to a stream before returning. @@ -173538,7 +172136,7 @@ Write all of the supplied data to a stream before returning. std::size_t ``[link asio.reference.write.overload13 write]``( SyncWriteStream & s, DynamicBuffer_v2 buffers, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.write.overload13 more...]]`` template< @@ -173548,7 +172146,7 @@ Write all of the supplied data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v2 buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.write.overload14 more...]]`` Write a certain amount of data to a stream before returning. @@ -173561,7 +172159,7 @@ Write a certain amount of data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.write.overload15 more...]]`` template< @@ -173573,12 +172171,12 @@ Write a certain amount of data to a stream before returning. DynamicBuffer_v2 buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 0); `` [''''»''' [link asio.reference.write.overload16 more...]]`` [heading Requirements] -['Header: ][^asio/write.hpp] +['Header: ][^asio/impl/write.hpp] ['Convenience header: ][^asio.hpp] @@ -173595,7 +172193,7 @@ Write all of the supplied data to a stream before returning. std::size_t write( SyncWriteStream & s, const ConstBufferSequence & buffers, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 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: @@ -173640,7 +172238,7 @@ The number of bytes transferred. To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::write(s, asio::buffer(data, size)); + asio::write(s, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -173650,9 +172248,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on w This overload is equivalent to calling: - asio::write( - s, buffers, - asio::transfer_all()); + asio::write( + s, buffers, + asio::transfer_all()); @@ -173677,7 +172275,7 @@ Write all of the supplied data to a stream before returning. SyncWriteStream & s, const ConstBufferSequence & buffers, asio::error_code & ec, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 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: @@ -173714,7 +172312,7 @@ The number of bytes transferred. To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::write(s, asio::buffer(data, size), ec); + asio::write(s, asio::buffer(data, size), ec); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -173724,9 +172322,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on w This overload is equivalent to calling: - asio::write( - s, buffers, - asio::transfer_all(), ec); + asio::write( + s, buffers, + asio::transfer_all(), ec); @@ -173752,7 +172350,7 @@ Write a certain amount of data to a stream before returning. SyncWriteStream & s, const ConstBufferSequence & buffers, CompletionCondition completion_condition, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 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: @@ -173778,12 +172376,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -173809,8 +172407,8 @@ The number of bytes transferred. To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::write(s, asio::buffer(data, size), - asio::transfer_at_least(32)); + asio::write(s, asio::buffer(data, size), + asio::transfer_at_least(32)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -173837,7 +172435,7 @@ Write a certain amount of data to a stream before returning. const ConstBufferSequence & buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_const_buffer_sequence< ConstBufferSequence >::value >::type = 0); + constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value > = 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: @@ -173863,12 +172461,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -173900,8 +172498,8 @@ Write all of the supplied data to a stream before returning. std::size_t write( SyncWriteStream & s, DynamicBuffer_v1 && buffers, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -173946,9 +172544,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write( - s, buffers, - asio::transfer_all()); + asio::write( + s, buffers, + asio::transfer_all()); @@ -173973,8 +172571,8 @@ Write all of the supplied data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v1 && buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -174011,9 +172609,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write( - s, buffers, - asio::transfer_all(), ec); + asio::write( + s, buffers, + asio::transfer_all(), ec); @@ -174039,8 +172637,8 @@ Write a certain amount of data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -174066,12 +172664,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -174114,8 +172712,8 @@ Write a certain amount of data to a stream before returning. DynamicBuffer_v1 && buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0, - typename constraint< !is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type = 0); + constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value > = 0, + constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value > = 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: @@ -174141,12 +172739,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -174222,9 +172820,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write( - s, b, - asio::transfer_all()); + asio::write( + s, b, + asio::transfer_all()); @@ -174285,9 +172883,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write( - s, b, - asio::transfer_all(), ec); + asio::write( + s, b, + asio::transfer_all(), ec); @@ -174338,12 +172936,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -174411,12 +173009,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -174448,7 +173046,7 @@ Write all of the supplied data to a stream before returning. std::size_t write( SyncWriteStream & s, DynamicBuffer_v2 buffers, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -174493,9 +173091,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write( - s, buffers, - asio::transfer_all()); + asio::write( + s, buffers, + asio::transfer_all()); @@ -174520,7 +173118,7 @@ Write all of the supplied data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v2 buffers, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -174557,9 +173155,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write( - s, buffers, - asio::transfer_all(), ec); + asio::write( + s, buffers, + asio::transfer_all(), ec); @@ -174585,7 +173183,7 @@ Write a certain amount of data to a stream before returning. SyncWriteStream & s, DynamicBuffer_v2 buffers, CompletionCondition completion_condition, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -174611,12 +173209,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -174659,7 +173257,7 @@ Write a certain amount of data to a stream before returning. DynamicBuffer_v2 buffers, CompletionCondition completion_condition, asio::error_code & ec, - typename constraint< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type = 0); + constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value > = 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: @@ -174685,12 +173283,12 @@ This operation is implemented in terms of zero or more calls to the stream's wri [[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, + // Result of latest write_some operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -174812,7 +173410,7 @@ Write a certain amount of data at a specified offset before returning. [heading Requirements] -['Header: ][^asio/write_at.hpp] +['Header: ][^asio/impl/write_at.hpp] ['Convenience header: ][^asio.hpp] @@ -174876,7 +173474,7 @@ The number of bytes transferred. To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::write_at(d, 42, asio::buffer(data, size)); + asio::write_at(d, 42, asio::buffer(data, size)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -174886,9 +173484,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on w This overload is equivalent to calling: - asio::write_at( - d, offset, buffers, - asio::transfer_all()); + asio::write_at( + d, offset, buffers, + asio::transfer_all()); @@ -174952,8 +173550,8 @@ The number of bytes transferred. To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::write_at(d, 42, - asio::buffer(data, size), ec); + asio::write_at(d, 42, + asio::buffer(data, size), ec); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -174963,9 +173561,9 @@ See the [link asio.reference.buffer `buffer`] documentation for information on w This overload is equivalent to calling: - asio::write_at( - d, offset, buffers, - asio::transfer_all(), ec); + asio::write_at( + d, offset, buffers, + asio::transfer_all(), ec); @@ -175019,12 +173617,12 @@ This operation is implemented in terms of zero or more calls to the device's wri [[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, + // Result of latest write_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -175050,8 +173648,8 @@ The number of bytes transferred. To write a single data buffer use the [link asio.reference.buffer `buffer`] function as follows: - asio::write_at(d, 42, asio::buffer(data, size), - asio::transfer_at_least(32)); + asio::write_at(d, 42, asio::buffer(data, size), + asio::transfer_at_least(32)); See the [link asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector. @@ -175106,12 +173704,12 @@ This operation is implemented in terms of zero or more calls to the device's wri [[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, + // Result of latest write_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -175190,9 +173788,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write_at( - d, 42, b, - asio::transfer_all()); + asio::write_at( + d, 42, b, + asio::transfer_all()); @@ -175256,9 +173854,9 @@ The number of bytes transferred. This overload is equivalent to calling: - asio::write_at( - d, 42, b, - asio::transfer_all(), ec); + asio::write_at( + d, 42, b, + asio::transfer_all(), ec); @@ -175312,12 +173910,12 @@ This operation is implemented in terms of zero or more calls to the device's wri [[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, + // Result of latest write_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -175388,12 +173986,12 @@ This operation is implemented in terms of zero or more calls to the device's wri [[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, + // Result of latest write_some_at operation. + const asio::error_code& error, - // Number of bytes transferred so far. - std::size_t bytes_transferred - ); + // 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.]] @@ -175498,12 +174096,12 @@ The [link asio.reference.basic_yield_context `basic_yield_context`] class is a c template - void my_coroutine(basic_yield_context yield) - { - ... - std::size_t n = my_socket.async_read_some(buffer, yield); - ... - } + void my_coroutine(basic_yield_context yield) + { + ... + std::size_t n = my_socket.async_read_some(buffer, yield); + ... + } @@ -175521,4 +174119,471 @@ The initiating function (async\_read\_some in the above example) suspends the cu [endsect] +[section:ip__address__gt_ ip::address >] + +[indexterm1 asio.indexterm.ip__address__gt_..ip::address >] + + + + template<> + struct hash< asio::ip::address > + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address__gt_.operator_lp__rp_ [*operator()]]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ip/address.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:operator_lp__rp_ ip::address >::operator()] + +[indexterm2 asio.indexterm.ip__address__gt_.operator_lp__rp_..operator()..ip::address >] + + std::size_t operator()( + const asio::ip::address & addr) const; + + + +[endsect] + + + +[endsect] + +[section:ip__address_v4__gt_ ip::address_v4 >] + +[indexterm1 asio.indexterm.ip__address_v4__gt_..ip::address_v4 >] + + + + template<> + struct hash< asio::ip::address_v4 > + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4__gt_.operator_lp__rp_ [*operator()]]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ip/address_v4.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:operator_lp__rp_ ip::address_v4 >::operator()] + +[indexterm2 asio.indexterm.ip__address_v4__gt_.operator_lp__rp_..operator()..ip::address_v4 >] + + std::size_t operator()( + const asio::ip::address_v4 & addr) const; + + + +[endsect] + + + +[endsect] + +[section:ip__address_v6__gt_ ip::address_v6 >] + +[indexterm1 asio.indexterm.ip__address_v6__gt_..ip::address_v6 >] + + + + template<> + struct hash< asio::ip::address_v6 > + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6__gt_.operator_lp__rp_ [*operator()]]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ip/address_v6.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:operator_lp__rp_ ip::address_v6 >::operator()] + +[indexterm2 asio.indexterm.ip__address_v6__gt_.operator_lp__rp_..operator()..ip::address_v6 >] + + std::size_t operator()( + const asio::ip::address_v6 & addr) const; + + + +[endsect] + + + +[endsect] + +[section:ip__basic_endpoint_lt__InternetProtocol__gt___gt_ ip::basic_endpoint< InternetProtocol > >] + +[indexterm1 asio.indexterm.ip__basic_endpoint_lt__InternetProtocol__gt___gt_..ip::basic_endpoint< InternetProtocol > >] + + + + template< + typename ``[link asio.reference.InternetProtocol InternetProtocol]``> + struct hash< asio::ip::basic_endpoint< InternetProtocol > > + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_endpoint_lt__InternetProtocol__gt___gt_.operator_lp__rp_ [*operator()]]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ip/basic_endpoint.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:operator_lp__rp_ ip::basic_endpoint< InternetProtocol > >::operator()] + +[indexterm2 asio.indexterm.ip__basic_endpoint_lt__InternetProtocol__gt___gt_.operator_lp__rp_..operator()..ip::basic_endpoint< InternetProtocol > >] + + std::size_t operator()( + const asio::ip::basic_endpoint< InternetProtocol > & ep) const; + + + +[endsect] + + + +[endsect] + +[section:error__addrinfo_errors__gt_ error::addrinfo_errors >] + +[indexterm1 asio.indexterm.error__addrinfo_errors__gt_..error::addrinfo_errors >] + + + + template<> + struct is_error_code_enum< asio::error::addrinfo_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.error__addrinfo_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/error.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:value error::addrinfo_errors >::value] + +[indexterm2 asio.indexterm.error__addrinfo_errors__gt_.value..value..error::addrinfo_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + +[section:error__basic_errors__gt_ error::basic_errors >] + +[indexterm1 asio.indexterm.error__basic_errors__gt_..error::basic_errors >] + + + + template<> + struct is_error_code_enum< asio::error::basic_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.error__basic_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/error.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:value error::basic_errors >::value] + +[indexterm2 asio.indexterm.error__basic_errors__gt_.value..value..error::basic_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + +[section:error__misc_errors__gt_ error::misc_errors >] + +[indexterm1 asio.indexterm.error__misc_errors__gt_..error::misc_errors >] + + + + template<> + struct is_error_code_enum< asio::error::misc_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.error__misc_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/error.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:value error::misc_errors >::value] + +[indexterm2 asio.indexterm.error__misc_errors__gt_.value..value..error::misc_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + +[section:error__netdb_errors__gt_ error::netdb_errors >] + +[indexterm1 asio.indexterm.error__netdb_errors__gt_..error::netdb_errors >] + + + + template<> + struct is_error_code_enum< asio::error::netdb_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.error__netdb_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/error.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:value error::netdb_errors >::value] + +[indexterm2 asio.indexterm.error__netdb_errors__gt_.value..value..error::netdb_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + +[section:error__ssl_errors__gt_ error::ssl_errors >] + +[indexterm1 asio.indexterm.error__ssl_errors__gt_..error::ssl_errors >] + + + + template<> + struct is_error_code_enum< asio::error::ssl_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.error__ssl_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ssl/error.hpp] + +['Convenience header: ][^asio/ssl.hpp] + + +[section:value error::ssl_errors >::value] + +[indexterm2 asio.indexterm.error__ssl_errors__gt_.value..value..error::ssl_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + +[section:experimental__error__channel_errors__gt_ experimental::error::channel_errors >] + +[indexterm1 asio.indexterm.experimental__error__channel_errors__gt_..experimental::error::channel_errors >] + + + + template<> + struct is_error_code_enum< asio::experimental::error::channel_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.experimental__error__channel_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/experimental/channel_error.hpp] + +['Convenience header: ]None + + +[section:value experimental::error::channel_errors >::value] + +[indexterm2 asio.indexterm.experimental__error__channel_errors__gt_.value..value..experimental::error::channel_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + +[section:ssl__error__stream_errors__gt_ ssl::error::stream_errors >] + +[indexterm1 asio.indexterm.ssl__error__stream_errors__gt_..ssl::error::stream_errors >] + + + + template<> + struct is_error_code_enum< asio::ssl::error::stream_errors > + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ssl__error__stream_errors__gt_.value [*value]] [static]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ssl/error.hpp] + +['Convenience header: ][^asio/ssl.hpp] + + +[section:value ssl::error::stream_errors >::value] + +[indexterm2 asio.indexterm.ssl__error__stream_errors__gt_.value..value..ssl::error::stream_errors >] + + static const bool value = true; + + + +[endsect] + + + +[endsect] + [endsect] diff --git a/asio/src/doc/tutorial.qbk b/asio/src/doc/tutorial.qbk index 692380d03b..ca81d148bd 100644 --- a/asio/src/doc/tutorial.qbk +++ b/asio/src/doc/tutorial.qbk @@ -69,8 +69,6 @@ This tutorial program introduces asio by showing how to perform a blocking wait - - We start by including the necessary header files. All of the asio classes can be used by simply including the `"asio.hpp"` header file. @@ -79,8 +77,6 @@ All of the asio classes can be used by simply including the `"asio.hpp"` header ``''''''``#include ``''''''``#include - - All programs that use asio need to have at least one I/O execution context, such as an [link asio.reference.io_context io_context] or [link asio.reference.thread_pool thread_pool] object. An I/O execution context provides access to I/O functionality. We declare an object of type @@ -92,8 +88,6 @@ All programs that use asio need to have at least one I/O execution context, such ``''''''``{ ``''''''`` 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 an executor, or a reference to an execution context (such as [link asio.reference.io_context io_context]), as their first constructor argument. The second argument to the constructor sets the timer to expire 5 seconds from now. @@ -101,17 +95,13 @@ Next we declare an object of type asio::steady\_timer. The core asio classes tha ``''''''`` 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 asio::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). - -In this simple example we perform a blocking wait on the timer. That is, the call to [link asio.reference.basic_waitable_timer.wait 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 [link asio.reference.basic_waitable_timer.wait steady_timer::wait()] function is called on an expired timer, it will return immediately. +A timer is always in one of two states: "expired" or "not expired". If the asio::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. @@ -121,11 +111,9 @@ Finally we print the obligatory `"Hello, world!"` message to show when the timer ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tuttimer1.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Next: [link asio.tutorial.tuttimer2 Timer.2 - Using a timer asynchronously] @@ -170,15 +158,9 @@ Return to [link asio.tutorial.tuttimer1 Timer.1 - Using a timer synchronously] This tutorial program demonstrates how to use asio's asynchronous functionality by modifying the program from tutorial Timer.1 to perform an asynchronous wait on the timer. - - - - ``''''''``#include ``''''''``#include - - Using asio's asynchronous functionality means supplying a [link asio.overview.model.completion_tokens completion token], which determines how the result will be delivered to a [*completion handler] when an [link asio.overview.model.async_ops asynchronous operation] completes. In this program we define a function called `print` to be called when the asynchronous wait finishes. @@ -194,22 +176,18 @@ Using asio's asynchronous functionality means supplying a [link asio.overview.mo ``''''''`` asio::steady_timer t(io, asio::chrono::seconds(5)); - - -Next, instead of doing a blocking wait as in tutorial Timer.1, we call the [link asio.reference.basic_waitable_timer.async_wait steady_timer::async_wait()] function to perform an asynchronous wait. When calling this function we pass the `print` function that was defined above. +Next, instead of doing a blocking wait as in tutorial Timer.1, we call the asio::steady\_timer::async\_wait() function to perform an asynchronous wait. When calling this function we pass the `print` function that was defined above. ``''''''`` t.async_wait(&print); +Finally, we must call the asio::io\_context::run() member function on the io\_context object. +The asio library provides a guarantee that completion handlers will only be called from threads that are currently calling asio::io\_context::run(). Therefore unless the asio::io\_context::run() function is called the completion handler for the asynchronous wait completion will never be invoked. -Finally, we must call the [link asio.reference.io_context.run io_context::run()] member function on the io\_context object. - -The asio library provides a guarantee that completion handlers will only be called from threads that are currently calling [link asio.reference.io_context.run io_context::run()]. Therefore unless the [link asio.reference.io_context.run io_context::run()] function is called the completion handler for the asynchronous wait completion will never be invoked. +The asio::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 completion handler has returned. -The [link asio.reference.io_context.run 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 completion handler has returned. - -It is important to remember to give the io\_context some work to do before calling [link asio.reference.io_context.run io_context::run()]. For example, if we had omitted the above call to [link asio.reference.basic_waitable_timer.async_wait steady_timer::async_wait()], the io\_context would not have had any work to do, and consequently [link asio.reference.io_context.run io_context::run()] would have returned immediately. +It is important to remember to give the io\_context some work to do before calling asio::io\_context::run(). For example, if we had omitted the above call to asio::steady\_timer::async\_wait(), the io\_context would not have had any work to do, and consequently asio::io\_context::run() would have returned immediately. ``''''''`` io.run(); @@ -217,11 +195,9 @@ It is important to remember to give the io\_context some work to do before calli ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tuttimer2.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tuttimer1 Timer.1 - Using a timer synchronously] @@ -273,16 +249,10 @@ Return to [link asio.tutorial.tuttimer2 Timer.2 - Using a timer asynchronously] 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 ``''''''``#include ``''''''``#include - - To implement a repeating timer using asio you need to change the timer's expiry time in your completion handler, and to then start a new asynchronous wait. Obviously this means that the completion handler 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; and @@ -300,9 +270,7 @@ at the end of the parameter list. ``''''''`` 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 [link asio.reference.io_context.run 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. +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 asio::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) @@ -310,17 +278,13 @@ As mentioned above, this tutorial program uses a counter to stop running when th ``''''''`` 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 [link asio.tutorial.boost_bind boost::bind] function is used to associate the extra parameters with your completion handler. The [link asio.reference.basic_waitable_timer.async_wait 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. +Then we start a new asynchronous wait on the timer. As you can see, the [link asio.tutorial.boost_bind boost::bind] function is used to associate the extra parameters with your completion handler. The asio::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 [@http://www.boost.org/libs/bind/bind.html Boost.Bind documentation] for more information on how to use [link asio.tutorial.boost_bind boost::bind]. @@ -336,8 +300,6 @@ In this example, the asio::placeholders::error argument to [link asio.tutorial.b ``''''''``{ ``''''''`` 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. @@ -345,9 +307,7 @@ A new `count` variable is added so that we can stop the program when the timer f ``''''''`` int count = 0; ``''''''`` asio::steady_timer t(io, asio::chrono::seconds(1)); - - -As in Step 4, when making the call to [link asio.reference.basic_waitable_timer.async_wait steady_timer::async_wait()] from `main` we bind the additional parameters needed for the `print` function. +As in Step 4, when making the call to asio::steady\_timer::async\_wait() from `main` we bind the additional parameters needed for the `print` function. ``''''''`` t.async_wait(boost::bind(print, @@ -355,8 +315,6 @@ As in Step 4, when making the call to [link asio.reference.basic_waitable_timer. ``''''''`` 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. @@ -366,11 +324,9 @@ Finally, just to prove that the `count` variable was being used in the `print` h ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tuttimer3.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tuttimer2 Timer.2 - Using a timer asynchronously] @@ -436,16 +392,10 @@ Return to [link asio.tutorial.tuttimer3 Timer.3 - Binding arguments to a complet In this tutorial we will see how to use a class member function as a completion handler. The program should execute identically to the tutorial program from tutorial Timer.3. - - - - ``''''''``#include ``''''''``#include ``''''''``#include - - Instead of defining a free function `print` as the completion handler, as we did in the earlier tutorial programs, we now define a class called `printer`. @@ -454,8 +404,6 @@ Instead of defining a free function `print` as the completion handler, as we did ``''''''``{ ``''''''``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. @@ -464,9 +412,8 @@ The constructor of this class will take a reference to the io\_context object an ``''''''`` count_(0) ``''''''`` { - - -The [link asio.tutorial.boost_bind 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, [link asio.tutorial.boost_bind boost::bind] converts our completion handler (now a member function) into a function object that can be invoked as though it has the signature `void(const asio::error_code&)`. +The [link asio.tutorial.boost_bind 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, [link asio.tutorial.boost_bind boost::bind] converts our completion 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. @@ -474,8 +421,6 @@ You will note that the asio::placeholders::error placeholder is not specified he ``''''''`` timer_.async_wait(boost::bind(&printer::print, this)); ``''''''`` } - - In the class destructor we will print out the final value of the counter. @@ -485,8 +430,6 @@ In the class destructor we will print out the final value of the counter. ``''''''`` 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. @@ -508,8 +451,6 @@ The `print` member function is very similar to the `print` function from tutoria ``''''''`` 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. @@ -523,11 +464,9 @@ The `main` function is much simpler than before, as it now declares a local `pri ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tuttimer4.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tuttimer3 Timer.3 - Binding arguments to a completion handler] @@ -606,7 +545,7 @@ Return to [link asio.tutorial.tuttimer4 Timer.4 - Using a member function as a c This tutorial demonstrates the use of the [link asio.reference.strand strand] class template to synchronise completion handlers in a multithreaded program. -The previous four tutorials avoided the issue of handler synchronisation by calling the [link asio.reference.io_context.run io_context::run()] function from one thread only. As you already know, the asio library provides a guarantee that completion handlers will only be called from threads that are currently calling [link asio.reference.io_context.run io_context::run()]. Consequently, calling [link asio.reference.io_context.run io_context::run()] from only one thread ensures that completion handlers cannot run concurrently. +The previous four tutorials avoided the issue of handler synchronisation by calling the asio::io\_context::run() function from one thread only. As you already know, the asio library provides a guarantee that completion handlers will only be called from threads that are currently calling asio::io\_context::run(). Consequently, calling asio::io\_context::run() from only one thread ensures that completion 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: @@ -618,19 +557,13 @@ The single threaded approach is usually the best place to start when developing -If you find yourself running into these limitations, an alternative approach is to have a pool of threads calling [link asio.reference.io_context.run 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. - - - - +If you find yourself running into these limitations, an alternative approach is to have a pool of threads calling asio::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 ``''''''``#include ``''''''``#include - - 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. @@ -639,12 +572,10 @@ We start by defining a class called `printer`, similar to the class in the previ ``''''''``{ ``''''''``public: - - In addition to initialising a pair of asio::steady\_timer members, the constructor initialises the `strand_` member, an object of type asio::strand. The -[link asio.reference.strand 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 [link asio.reference.io_context.run io_context::run()]. Of course, the handlers may still execute concurrently with other handlers that were not dispatched through an +[link asio.reference.strand 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 asio::io\_context::run(). Of course, the handlers may still execute concurrently with other handlers that were not dispatched through an [link asio.reference.strand strand], or were dispatched through a different [link asio.reference.strand strand] object. @@ -656,8 +587,6 @@ The ``''''''`` count_(0) ``''''''`` { - - When initiating the asynchronous operations, each completion handler is "bound" to an asio::strand object. The asio::bind\_executor() function returns a new handler that automatically dispatches its contained handler through the [link asio.reference.strand strand] object. By binding the handlers to the same [link asio.reference.strand strand], we are ensuring that they cannot execute concurrently. @@ -675,8 +604,6 @@ When initiating the asynchronous operations, each completion handler is "bound" ``''''''`` 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. @@ -716,12 +643,10 @@ In a multithreaded program, the handlers for asynchronous operations should be s ``''''''`` int count_; ``''''''``}; - - -The `main` function now causes [link asio.reference.io_context.run io_context::run()] to be called from two threads: the main thread and one additional thread. This is accomplished using an +The `main` function now causes asio::io\_context::run() to be called from two threads: the main thread and one additional thread. This is accomplished using an [link asio.reference.thread thread] object. -Just as it would with a call from a single thread, concurrent calls to [link asio.reference.io_context.run 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. +Just as it would with a call from a single thread, concurrent calls to asio::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. @@ -736,11 +661,9 @@ Just as it would with a call from a single thread, concurrent calls to [link asi ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tuttimer5.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tuttimer4 Timer.4 - Using a member function as a completion handler] @@ -844,8 +767,6 @@ This tutorial program shows how to use asio to implement a client application wi - - We start by including the necessary header files. @@ -853,8 +774,6 @@ We start by including the necessary header files. ``''''''``#include ``''''''``#include - - The purpose of this application is to access a daytime service, so we need the user to specify the server. @@ -871,8 +790,6 @@ The purpose of this application is to access a daytime service, so we need the u ``''''''`` return 1; ``''''''`` } - - All programs that use asio need to have at least one I/O execution context, such as an [link asio.reference.io_context io_context] object. @@ -880,26 +797,20 @@ All programs that use asio need to have at least one I/O execution context, such ``''''''`` 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 [link asio.reference.ip__tcp.resolver ip::tcp::resolver] object. +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 asio::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 [link asio.reference.ip__basic_resolver.results_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. +The list of endpoints is returned using an object of type asio::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. @@ -907,8 +818,6 @@ Now we create and connect the socket. The list of endpoints obtained above may c ``''''''`` 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`. @@ -922,9 +831,7 @@ We use a `boost::array` to hold the received data. The asio::buffer() function a ``''''''`` size_t len = socket.read_some(asio::buffer(buf), error); - - -When the server closes the connection, the [link asio.reference.basic_stream_socket.read_some ip::tcp::socket::read_some()] function will exit with the asio::error::eof error, which is how we know to exit the loop. +When the server closes the connection, the asio::ip::tcp::socket::read\_some() function will exit with the asio::error::eof error, which is how we know to exit the loop. @@ -936,8 +843,6 @@ When the server closes the connection, the [link asio.reference.basic_stream_soc ``''''''`` std::cout.write(buf.data(), len); ``''''''`` } - - Finally, handle any exceptions that may have been thrown. @@ -947,11 +852,9 @@ Finally, handle any exceptions that may have been thrown. ``''''''`` std::cerr << e.what() << std::endl; ``''''''`` } - - See the [link asio.tutorial.tutdaytime1.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Next: [link asio.tutorial.tutdaytime2 Daytime.2 - A synchronous TCP daytime server] @@ -1029,10 +932,6 @@ Return to [link asio.tutorial.tutdaytime1 Daytime.1 - A synchronous TCP daytime This tutorial program shows how to use asio to implement a server application with TCP. - - - - ``''''''``#include ``''''''``#include ``''''''``#include @@ -1040,8 +939,6 @@ This tutorial program shows how to use asio to implement a server application wi ``''''''``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. @@ -1059,16 +956,12 @@ We define the function `make_daytime_string()` to create the string to be sent b ``''''''`` { ``''''''`` asio::io_context io_context; - - -A [link asio.reference.ip__tcp.acceptor 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. +A asio::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. @@ -1078,8 +971,6 @@ This is an iterative server, which means that it will handle one connection at a ``''''''`` 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. @@ -1091,8 +982,6 @@ A client is accessing our service. Determine the current time and transfer this ``''''''`` } ``''''''`` } - - Finally, handle any exceptions. @@ -1104,11 +993,9 @@ Finally, handle any exceptions. ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tutdaytime2.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tutdaytime1 Daytime.1 - A synchronous TCP daytime client] @@ -1186,8 +1073,6 @@ Return to [link asio.tutorial.tutdaytime2 Daytime.2 - A synchronous TCP daytime ``''''''`` try ``''''''`` { - - We need to create a server object to accept incoming client connections. The [link asio.reference.io_context io_context] object provides I/O services, such as sockets, that the server object will use. @@ -1195,8 +1080,6 @@ We need to create a server object to accept incoming client connections. The ``''''''`` asio::io_context io_context; ``''''''`` tcp_server server(io_context); - - Run the [link asio.reference.io_context io_context] object so that it will perform asynchronous operations on your behalf. @@ -1220,8 +1103,6 @@ Run the ``''''''``{ ``''''''``public: - - The constructor initialises an acceptor to listen on TCP port 13. @@ -1234,8 +1115,6 @@ The constructor initialises an acceptor to listen on TCP port 13. ``''''''``private: - - The function `start_accept()` creates a socket and initiates an asynchronous accept operation to wait for a new connection. @@ -1249,8 +1128,6 @@ The function `start_accept()` creates a socket and initiates an asynchronous acc ``''''''`` 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. @@ -1289,24 +1166,18 @@ We will use `shared_ptr` and `enable_shared_from_this` because we want to keep t ``''''''`` 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 [link asio.reference.basic_stream_socket.async_write_some ip::tcp::socket::async_write_some()], to ensure that the entire block of data is sent. +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 asio::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 [link asio.tutorial.boost_bind 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()`. @@ -1316,8 +1187,6 @@ When initiating the asynchronous operation, and if using [link asio.tutorial.boo ``''''''`` asio::placeholders::error, ``''''''`` asio::placeholders::bytes_transferred)); - - Any further actions for this client connection are now the responsibility of `handle_write()`. @@ -1345,23 +1214,23 @@ Any further actions for this client connection are now the responsibility of `ha 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() - ``''''''`` { - ``''''''`` } + ``''''''``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())); + ``''''''``asio::async_write(socket_, asio::buffer(message_), + ``''''''`` boost::bind(&tcp_connection::handle_write, shared_from_this())); See the [link asio.tutorial.tutdaytime3.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tutdaytime2 Daytime.2 - A synchronous TCP daytime server] @@ -1509,8 +1378,6 @@ This tutorial program shows how to use asio to implement a client application wi ``''''''``using asio::ip::udp; - - The start of the application is essentially the same as for the TCP daytime client. @@ -1527,9 +1394,7 @@ The start of the application is essentially the same as for the TCP daytime clie ``''''''`` asio::io_context io_context; - - -We use an [link asio.reference.ip__udp.resolver 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 [link asio.reference.ip__udp.v4 ip::udp::v4()] argument. +We use an asio::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 asio::ip::udp::v4() argument. @@ -1537,11 +1402,9 @@ We use an [link asio.reference.ip__udp.resolver ip::udp::resolver] object to fin ``''''''`` udp::endpoint receiver_endpoint = ``''''''`` *resolver.resolve(udp::v4(), argv[1], "daytime").begin(); +The asio::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. - -The [link asio.reference.ip__basic_resolver.resolve 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 [link asio.reference.ip__udp.socket ip::udp::socket] and initiate contact with the remote endpoint. +Since UDP is datagram-oriented, we will not be using a stream socket. Create an asio::ip::udp::socket and initiate contact with the remote endpoint. @@ -1551,9 +1414,7 @@ Since UDP is datagram-oriented, we will not be using a stream socket. Create an ``''''''`` boost::array 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 [link asio.reference.basic_datagram_socket.receive_from ip::udp::socket::receive_from()]. +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 asio::ip::udp::socket::receive\_from(). @@ -1565,8 +1426,6 @@ Now we need to be ready to accept whatever the server sends back to us. The endp ``''''''`` std::cout.write(recv_buf.data(), len); ``''''''`` } - - Finally, handle any exceptions that may have been thrown. @@ -1580,7 +1439,7 @@ Finally, handle any exceptions that may have been thrown. See the [link asio.tutorial.tutdaytime4.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tutdaytime3 Daytime.3 - An asynchronous TCP daytime server] @@ -1661,17 +1520,13 @@ This tutorial program shows how to use asio to implement a server application wi ``''''''`` { ``''''''`` asio::io_context io_context; - - -Create an [link asio.reference.ip__udp.socket ip::udp::socket] object to receive requests on UDP port 13. +Create an asio::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 [link asio.reference.basic_datagram_socket.receive_from ip::udp::socket::receive_from()]. +Wait for a client to initiate contact with us. The remote\_endpoint object will be populated by asio::ip::udp::socket::receive\_from(). @@ -1681,16 +1536,12 @@ Wait for a client to initiate contact with us. The remote\_endpoint object will ``''''''`` 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. @@ -1701,8 +1552,6 @@ Send the response to the remote\_endpoint. ``''''''`` } ``''''''`` } - - Finally, handle any exceptions. @@ -1714,11 +1563,9 @@ Finally, handle any exceptions. ``''''''`` return 0; ``''''''``} - - See the [link asio.tutorial.tutdaytime5.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tutdaytime4 Daytime.4 - A synchronous UDP daytime client] @@ -1799,8 +1646,6 @@ Return to [link asio.tutorial.tutdaytime5 Daytime.5 - A synchronous UDP daytime ``''''''`` try ``''''''`` { - - Create a server object to accept incoming client requests, and run the [link asio.reference.io_context io_context] object. @@ -1826,8 +1671,6 @@ Create a server object to accept incoming client requests, and run the ``''''''``{ ``''''''``public: - - The constructor initialises a socket to listen on UDP port 13. @@ -1841,11 +1684,8 @@ The constructor initialises a socket to listen on UDP port 13. ``''''''`` void start_receive() ``''''''`` { - - -The function [link asio.reference.basic_datagram_socket.async_receive_from 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 -[link asio.reference.io_context io_context] object will invoke the `handle_receive()` function with two arguments: a value of type -[link asio.reference.error_code error_code] indicating whether the operation succeeded or failed, and a `size_t` value `bytes_transferred` specifying the number of bytes received. +The function asio::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 +[link asio.reference.io_context io_context] object will invoke the `handle_receive()` function with two arguments: a value of type asio::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( @@ -1855,8 +1695,6 @@ The function [link asio.reference.basic_datagram_socket.async_receive_from ip::u ``''''''`` asio::placeholders::bytes_transferred)); ``''''''`` } - - The function `handle_receive()` will service the client request. @@ -1865,8 +1703,6 @@ The function `handle_receive()` will service the client request. ``''''''`` 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 [link asio.reference.io_context io_context] object would return an error if the client sent anything larger. We can ignore such an error if it comes up. @@ -1874,17 +1710,13 @@ The `error` parameter contains the result of the asynchronous operation. Since w ``''''''`` if (!error) ``''''''`` { - - Determine what we are going to send. ``''''''`` boost::shared_ptr message( ``''''''`` new std::string(make_daytime_string())); - - -We now call [link asio.reference.basic_datagram_socket.async_send_to ip::udp::socket::async_send_to()] to serve the data to the client. +We now call asio::ip::udp::socket::async\_send\_to() to serve the data to the client. @@ -1893,8 +1725,6 @@ We now call [link asio.reference.basic_datagram_socket.async_send_to ip::udp::so ``''''''`` asio::placeholders::error, ``''''''`` asio::placeholders::bytes_transferred)); - - When initiating the asynchronous operation, and if using [link asio.tutorial.boost_bind 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. @@ -1903,16 +1733,12 @@ 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. @@ -1928,11 +1754,9 @@ The function `handle_send()` is invoked after the service request has been compl ``''''''`` boost::array recv_buffer_; ``''''''``}; - - See the [link asio.tutorial.tutdaytime6.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tutdaytime5 Daytime.5 - A synchronous UDP daytime server] @@ -2052,22 +1876,16 @@ This tutorial program shows how to combine the two asynchronous servers that we ``''''''`` { ``''''''`` 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 [link asio.reference.io_context io_context] object to do. @@ -2211,11 +2029,9 @@ Similarly, this next class is taken from the [link asio.tutorial.tutdaytime6 pre ``''''''`` boost::array recv_buffer_; ``''''''``}; - - See the [link asio.tutorial.tutdaytime7.src full source listing] -Return to the [link asio.tutorial tutorial index] +Return to the tutorial index Previous: [link asio.tutorial.tutdaytime6 Daytime.6 - An asynchronous UDP daytime server] From 75e7d0430a75d035ee5b0d3ec5acdcc7d80fca3f Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Thu, 9 Nov 2023 00:25:15 +1100 Subject: [PATCH 03/10] Revision history. --- asio/src/doc/history.qbk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/asio/src/doc/history.qbk b/asio/src/doc/history.qbk index 47b720789e..f9ae3a7476 100644 --- a/asio/src/doc/history.qbk +++ b/asio/src/doc/history.qbk @@ -7,6 +7,31 @@ [section:history Revision History] +[heading Asio 1.29.0] + +* Changed to require C++11 as the minimum language standard. + +* Removed deprecated functionality from the `asio::execution` namespace. + +* Removed deprecated invocation and allocation hooks. + +* Added compatibility between Asio's placeholders and `std::bind`. + +* Added `try_send_via_dispatch` and `try_send_n_via_dispatch` functions to + channels. + +* Improved C++11 support for multi-signature channels. + +* Fixed compatibility between channel asynchronous operations and + `any_completion_handler`. + +* Added missing equality operators for mixed property types belonging to the + same category. + +* Fixed an issue where `spawn`-based stackful coroutines would terminate the + program when used with asynchronous operations that have a completion + signature starting with `std::exception_ptr`. + [heading Asio 1.28.2] * Fixed the completion token adapters `bind_allocator`, `bind_cancellation_slot` From 814f67e730e154547aea3f4d99f709cbdf1ea4a0 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Thu, 9 Nov 2023 00:50:57 +1100 Subject: [PATCH 04/10] asio version 1.29.0 released --- asio/README | 4 +- asio/asio.manifest | 487 +++++++++++++++------------------- asio/boost_asio.manifest | 431 +++++++++++++----------------- asio/configure.ac | 2 +- asio/include/asio/version.hpp | 2 +- 5 files changed, 403 insertions(+), 523 deletions(-) diff --git a/asio/README b/asio/README index ff440ae4de..ff82cc02d6 100644 --- a/asio/README +++ b/asio/README @@ -1,4 +1,4 @@ -asio version 1.28.2 -Released Thursday, 26 October 2023. +asio version 1.29.0 +Released Thursday, 09 November 2023. See doc/index.html for API documentation and a tutorial. diff --git a/asio/asio.manifest b/asio/asio.manifest index 038256cc15..0012e2c453 100644 --- a/asio/asio.manifest +++ b/asio/asio.manifest @@ -200,20 +200,21 @@ /doc/asio/reference/any_completion_handler_allocator/any_completion_handler_allocator.html /doc/asio/reference/any_completion_handler_allocator/deallocate.html /doc/asio/reference/any_completion_handler_allocator.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/ -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/any_completion_handler_allocator.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/operator_eq__eq_.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/operator_not__eq_.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind/ -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind/other.html -/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/value_type.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/ +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/any_completion_handler_allocator.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/operator_eq__eq_.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/operator_not__eq_.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind/ +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind/other.html +/doc/asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/value_type.html /doc/asio/reference/any_completion_handler_allocator/operator_eq__eq_.html /doc/asio/reference/any_completion_handler_allocator/operator_not__eq_.html /doc/asio/reference/any_completion_handler_allocator__rebind/ /doc/asio/reference/any_completion_handler_allocator__rebind.html /doc/asio/reference/any_completion_handler_allocator__rebind/other.html +/doc/asio/reference/any_completion_handler/allocator_type.html /doc/asio/reference/any_completion_handler_allocator/value_type.html /doc/asio/reference/any_completion_handler/any_completion_handler/ /doc/asio/reference/any_completion_handler/_any_completion_handler.html @@ -222,6 +223,7 @@ /doc/asio/reference/any_completion_handler/any_completion_handler/overload2.html /doc/asio/reference/any_completion_handler/any_completion_handler/overload3.html /doc/asio/reference/any_completion_handler/any_completion_handler/overload4.html +/doc/asio/reference/any_completion_handler/cancellation_slot_type.html /doc/asio/reference/any_completion_handler/get_allocator.html /doc/asio/reference/any_completion_handler/get_cancellation_slot.html /doc/asio/reference/any_completion_handler.html @@ -304,18 +306,12 @@ /doc/asio/reference/append_t.html /doc/asio/reference/append_t/token_.html /doc/asio/reference/append_t/values_.html -/doc/asio/reference/asio_handler_allocate.html -/doc/asio/reference/asio_handler_deallocate.html -/doc/asio/reference/asio_handler_invoke/ -/doc/asio/reference/asio_handler_invoke.html -/doc/asio/reference/asio_handler_invoke/overload1.html -/doc/asio/reference/asio_handler_invoke/overload2.html /doc/asio/reference/asio_handler_is_continuation.html /doc/asio/reference/associated_allocator/ -/doc/asio/reference/associated_allocator/decltype/ -/doc/asio/reference/associated_allocator/decltype.html -/doc/asio/reference/associated_allocator/decltype/overload1.html -/doc/asio/reference/associated_allocator/decltype/overload2.html +/doc/asio/reference/associated_allocator/get/ +/doc/asio/reference/associated_allocator/get.html +/doc/asio/reference/associated_allocator/get/overload1.html +/doc/asio/reference/associated_allocator/get/overload2.html /doc/asio/reference/associated_allocator.html /doc/asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/ /doc/asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/get/ @@ -324,13 +320,13 @@ /doc/asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/get/overload2.html /doc/asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_.html /doc/asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/type.html -/doc/asio/reference/associated_allocator/noexcept.html +/doc/asio/reference/associated_allocator_t.html /doc/asio/reference/associated_allocator/type.html /doc/asio/reference/associated_cancellation_slot/ -/doc/asio/reference/associated_cancellation_slot/decltype/ -/doc/asio/reference/associated_cancellation_slot/decltype.html -/doc/asio/reference/associated_cancellation_slot/decltype/overload1.html -/doc/asio/reference/associated_cancellation_slot/decltype/overload2.html +/doc/asio/reference/associated_cancellation_slot/get/ +/doc/asio/reference/associated_cancellation_slot/get.html +/doc/asio/reference/associated_cancellation_slot/get/overload1.html +/doc/asio/reference/associated_cancellation_slot/get/overload2.html /doc/asio/reference/associated_cancellation_slot.html /doc/asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/ /doc/asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/get/ @@ -339,13 +335,13 @@ /doc/asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/get/overload2.html /doc/asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_.html /doc/asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/type.html -/doc/asio/reference/associated_cancellation_slot/noexcept.html +/doc/asio/reference/associated_cancellation_slot_t.html /doc/asio/reference/associated_cancellation_slot/type.html /doc/asio/reference/associated_executor/ -/doc/asio/reference/associated_executor/decltype/ -/doc/asio/reference/associated_executor/decltype.html -/doc/asio/reference/associated_executor/decltype/overload1.html -/doc/asio/reference/associated_executor/decltype/overload2.html +/doc/asio/reference/associated_executor/get/ +/doc/asio/reference/associated_executor/get.html +/doc/asio/reference/associated_executor/get/overload1.html +/doc/asio/reference/associated_executor/get/overload2.html /doc/asio/reference/associated_executor.html /doc/asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/ /doc/asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/get/ @@ -354,21 +350,22 @@ /doc/asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/get/overload2.html /doc/asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.html /doc/asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/type.html -/doc/asio/reference/associated_executor/noexcept.html +/doc/asio/reference/associated_executor_t.html /doc/asio/reference/associated_executor/type.html /doc/asio/reference/associated_immediate_executor/ -/doc/asio/reference/associated_immediate_executor/decltype.html +/doc/asio/reference/associated_immediate_executor/get.html /doc/asio/reference/associated_immediate_executor.html /doc/asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/ /doc/asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/get.html /doc/asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.html /doc/asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/type.html -/doc/asio/reference/associated_immediate_executor/noexcept.html +/doc/asio/reference/associated_immediate_executor_t.html /doc/asio/reference/associated_immediate_executor/type.html /doc/asio/reference/associator.html /doc/asio/reference/as_tuple.html /doc/asio/reference/as_tuple_t/ /doc/asio/reference/as_tuple_t/as_default_on.html +/doc/asio/reference/as_tuple_t/as_default_on_t.html /doc/asio/reference/as_tuple_t/as_tuple_t/ /doc/asio/reference/as_tuple_t/as_tuple_t.html /doc/asio/reference/as_tuple_t/as_tuple_t/overload1.html @@ -789,6 +786,29 @@ /doc/asio/reference/basic_io_object/get_service/overload2.html /doc/asio/reference/basic_io_object.html /doc/asio/reference/basic_io_object/implementation_type.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/ +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/ +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/_basic_io_object.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/overload1.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/overload2.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/overload3.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/executor_type.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_executor.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation/ +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation/overload1.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation/overload2.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_io_context.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_io_service.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service/ +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service/overload1.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service/overload2.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/implementation_type.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/operator_eq_.html +/doc/asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/service_type.html /doc/asio/reference/basic_io_object/operator_eq_.html /doc/asio/reference/basic_io_object/service_type.html /doc/asio/reference/basic_random_access_file/ @@ -2305,11 +2325,7 @@ /doc/asio/reference/buffer/overload36.html /doc/asio/reference/buffer/overload37.html /doc/asio/reference/buffer/overload38.html -/doc/asio/reference/buffer/overload39.html /doc/asio/reference/buffer/overload3.html -/doc/asio/reference/buffer/overload40.html -/doc/asio/reference/buffer/overload41.html -/doc/asio/reference/buffer/overload42.html /doc/asio/reference/buffer/overload4.html /doc/asio/reference/buffer/overload5.html /doc/asio/reference/buffer/overload6.html @@ -2386,7 +2402,7 @@ /doc/asio/reference/buffers_iterator/operator_plus__plus_.html /doc/asio/reference/buffers_iterator/operator_plus__plus_/overload1.html /doc/asio/reference/buffers_iterator/operator_plus__plus_/overload2.html -/doc/asio/reference/buffers_iterator/operator__star_.html +/doc/asio/reference/buffers_iterator/operator_star_.html /doc/asio/reference/buffers_iterator/pointer.html /doc/asio/reference/buffers_iterator/reference.html /doc/asio/reference/buffers_iterator/value_type.html @@ -2461,6 +2477,7 @@ /doc/asio/reference/CompletionCondition.html /doc/asio/reference/completion_signature_of/ /doc/asio/reference/completion_signature_of.html +/doc/asio/reference/completion_signature_of_t.html /doc/asio/reference/completion_signature_of/type.html /doc/asio/reference/connect/ /doc/asio/reference/ConnectCondition.html @@ -2551,6 +2568,7 @@ /doc/asio/reference/deadline_timer.html /doc/asio/reference/default_completion_token/ /doc/asio/reference/default_completion_token.html +/doc/asio/reference/default_completion_token_t.html /doc/asio/reference/default_completion_token/type.html /doc/asio/reference/defer/ /doc/asio/reference/defer.html @@ -2559,30 +2577,43 @@ /doc/asio/reference/defer/overload3.html /doc/asio/reference/deferred_async_operation/ /doc/asio/reference/deferred_async_operation/deferred_async_operation.html -/doc/asio/reference/deferred_async_operation/detail__index_sequence_for.html /doc/asio/reference/deferred_async_operation.html -/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/ -/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/deferred_async_operation.html -/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/detail__index_sequence_for.html -/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.html -/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/operator_lp__rp_.html +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/ +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/deferred_async_operation.html +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.html +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_/ +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_.html +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_/overload1.html +/doc/asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_/overload2.html +/doc/asio/reference/deferred_async_operation/operator_lp__rp_/ /doc/asio/reference/deferred_async_operation/operator_lp__rp_.html +/doc/asio/reference/deferred_async_operation/operator_lp__rp_/overload1.html +/doc/asio/reference/deferred_async_operation/operator_lp__rp_/overload2.html /doc/asio/reference/deferred_conditional/ /doc/asio/reference/deferred_conditional/deferred_conditional.html /doc/asio/reference/deferred_conditional.html +/doc/asio/reference/deferred_conditional/operator_lp__rp_/ /doc/asio/reference/deferred_conditional/operator_lp__rp_.html +/doc/asio/reference/deferred_conditional/operator_lp__rp_/overload1.html +/doc/asio/reference/deferred_conditional/operator_lp__rp_/overload2.html /doc/asio/reference/deferred_conditional/otherwise.html /doc/asio/reference/deferred_conditional/then.html /doc/asio/reference/deferred_function/ /doc/asio/reference/deferred_function/deferred_function.html /doc/asio/reference/deferred_function/function_.html /doc/asio/reference/deferred_function.html +/doc/asio/reference/deferred_function/operator_lp__rp_/ /doc/asio/reference/deferred_function/operator_lp__rp_.html +/doc/asio/reference/deferred_function/operator_lp__rp_/overload1.html +/doc/asio/reference/deferred_function/operator_lp__rp_/overload2.html /doc/asio/reference/deferred.html /doc/asio/reference/deferred_init_tag.html /doc/asio/reference/deferred_noop/ /doc/asio/reference/deferred_noop.html +/doc/asio/reference/deferred_noop/operator_lp__rp_/ /doc/asio/reference/deferred_noop/operator_lp__rp_.html +/doc/asio/reference/deferred_noop/operator_lp__rp_/overload1.html +/doc/asio/reference/deferred_noop/operator_lp__rp_/overload2.html /doc/asio/reference/deferred_sequence/ /doc/asio/reference/deferred_sequence/deferred_sequence.html /doc/asio/reference/deferred_sequence.html @@ -2593,6 +2624,7 @@ /doc/asio/reference/deferred_signatures.html /doc/asio/reference/deferred_t/ /doc/asio/reference/deferred_t/as_default_on.html +/doc/asio/reference/deferred_t/as_default_on_t.html /doc/asio/reference/deferred_t/deferred_t.html /doc/asio/reference/deferred_t__executor_with_default/ /doc/asio/reference/deferred_t__executor_with_default/default_completion_token_type.html @@ -2607,15 +2639,18 @@ /doc/asio/reference/deferred_t/when.html /doc/asio/reference/deferred_values/ /doc/asio/reference/deferred_values/deferred_values.html -/doc/asio/reference/deferred_values/detail__index_sequence_for.html /doc/asio/reference/deferred_values.html /doc/asio/reference/deferred_values__initiate/ /doc/asio/reference/deferred_values__initiate.html /doc/asio/reference/deferred_values__initiate/operator_lp__rp_.html +/doc/asio/reference/deferred_values/operator_lp__rp_/ /doc/asio/reference/deferred_values/operator_lp__rp_.html +/doc/asio/reference/deferred_values/operator_lp__rp_/overload1.html +/doc/asio/reference/deferred_values/operator_lp__rp_/overload2.html /doc/asio/reference/detached.html /doc/asio/reference/detached_t/ /doc/asio/reference/detached_t/as_default_on.html +/doc/asio/reference/detached_t/as_default_on_t.html /doc/asio/reference/detached_t/detached_t.html /doc/asio/reference/detached_t__executor_with_default/ /doc/asio/reference/detached_t__executor_with_default/default_completion_token_type.html @@ -2690,35 +2725,17 @@ /doc/asio/reference/Endpoint.html /doc/asio/reference/EndpointSequence.html /doc/asio/reference/error__addrinfo_category.html +/doc/asio/reference/error__addrinfo_errors__gt_/ +/doc/asio/reference/error__addrinfo_errors__gt_.html +/doc/asio/reference/error__addrinfo_errors__gt_/value.html /doc/asio/reference/error__addrinfo_errors.html +/doc/asio/reference/error__basic_errors__gt_/ +/doc/asio/reference/error__basic_errors__gt_.html +/doc/asio/reference/error__basic_errors__gt_/value.html /doc/asio/reference/error__basic_errors.html -/doc/asio/reference/error_category/ -/doc/asio/reference/error_category/_error_category.html /doc/asio/reference/error_category.html -/doc/asio/reference/error_category/message.html -/doc/asio/reference/error_category/name.html -/doc/asio/reference/error_category/operator_eq__eq_.html -/doc/asio/reference/error_category/operator_not__eq_.html /doc/asio/reference/error__clear.html -/doc/asio/reference/error_code/ -/doc/asio/reference/error_code/assign.html -/doc/asio/reference/error_code/category.html -/doc/asio/reference/error_code/clear.html -/doc/asio/reference/error_code/error_code/ -/doc/asio/reference/error_code/error_code.html -/doc/asio/reference/error_code/error_code/overload1.html -/doc/asio/reference/error_code/error_code/overload2.html -/doc/asio/reference/error_code/error_code/overload3.html /doc/asio/reference/error_code.html -/doc/asio/reference/error_code/message.html -/doc/asio/reference/error_code/operator_eq__eq_.html -/doc/asio/reference/error_code/operator_not__eq_.html -/doc/asio/reference/error_code/operator_not_.html -/doc/asio/reference/error_code/operator_unspecified_bool_type.html -/doc/asio/reference/error_code/unspecified_bool_true.html -/doc/asio/reference/error_code/unspecified_bool_type.html -/doc/asio/reference/error_code__unspecified_bool_type_t.html -/doc/asio/reference/error_code/value.html /doc/asio/reference/error__get_addrinfo_category.html /doc/asio/reference/error__get_misc_category.html /doc/asio/reference/error__get_netdb_category.html @@ -2732,10 +2749,19 @@ /doc/asio/reference/error__make_error_code/overload4.html /doc/asio/reference/error__make_error_code/overload5.html /doc/asio/reference/error__misc_category.html +/doc/asio/reference/error__misc_errors__gt_/ +/doc/asio/reference/error__misc_errors__gt_.html +/doc/asio/reference/error__misc_errors__gt_/value.html /doc/asio/reference/error__misc_errors.html /doc/asio/reference/error__netdb_category.html +/doc/asio/reference/error__netdb_errors__gt_/ +/doc/asio/reference/error__netdb_errors__gt_.html +/doc/asio/reference/error__netdb_errors__gt_/value.html /doc/asio/reference/error__netdb_errors.html /doc/asio/reference/error__ssl_category.html +/doc/asio/reference/error__ssl_errors__gt_/ +/doc/asio/reference/error__ssl_errors__gt_.html +/doc/asio/reference/error__ssl_errors__gt_/value.html /doc/asio/reference/error__ssl_errors.html /doc/asio/reference/error__system_category.html /doc/asio/reference/execution__allocator.html @@ -2867,62 +2893,6 @@ /doc/asio/reference/execution__blocking_t__possibly_t/polymorphic_query_result_type.html /doc/asio/reference/execution__blocking_t__possibly_t/possibly_t.html /doc/asio/reference/execution__blocking_t__possibly_t/value.html -/doc/asio/reference/execution__bulk_execute.html -/doc/asio/reference/execution__bulk_guarantee.html -/doc/asio/reference/execution__bulk_guarantee_t/ -/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/ -/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t.html -/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload1.html -/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload2.html -/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload3.html -/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload4.html -/doc/asio/reference/execution__bulk_guarantee_t.html -/doc/asio/reference/execution__bulk_guarantee_t/is_applicable_property_v.html -/doc/asio/reference/execution__bulk_guarantee_t/is_preferable.html -/doc/asio/reference/execution__bulk_guarantee_t/is_requirable.html -/doc/asio/reference/execution__bulk_guarantee_t/operator_eq__eq_.html -/doc/asio/reference/execution__bulk_guarantee_t/operator_not__eq_.html -/doc/asio/reference/execution__bulk_guarantee_t/parallel.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/ -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_applicable_property_v.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_preferable.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_requirable.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/parallel_t.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/polymorphic_query_result_type.html -/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/value.html -/doc/asio/reference/execution__bulk_guarantee_t/polymorphic_query_result_type.html -/doc/asio/reference/execution__bulk_guarantee_t/sequenced.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/ -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_applicable_property_v.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_preferable.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_requirable.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/polymorphic_query_result_type.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/sequenced_t.html -/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/value.html -/doc/asio/reference/execution__bulk_guarantee_t/unsequenced.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/ -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_applicable_property_v.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_preferable.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_requirable.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/polymorphic_query_result_type.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/unsequenced_t.html -/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/value.html -/doc/asio/reference/execution__can_bulk_execute.html -/doc/asio/reference/execution__can_connect.html -/doc/asio/reference/execution__can_execute.html -/doc/asio/reference/execution__can_schedule.html -/doc/asio/reference/execution__can_set_done.html -/doc/asio/reference/execution__can_set_error.html -/doc/asio/reference/execution__can_set_value.html -/doc/asio/reference/execution__can_start.html -/doc/asio/reference/execution__can_submit.html -/doc/asio/reference/execution__connect.html -/doc/asio/reference/execution__connect_result/ -/doc/asio/reference/execution__connect_result.html -/doc/asio/reference/execution__connect_result/type.html /doc/asio/reference/execution_context/ /doc/asio/reference/execution_context/add_service.html /doc/asio/reference/execution__context_as.html @@ -2963,26 +2933,10 @@ /doc/asio/reference/execution_context/use_service.html /doc/asio/reference/execution_context/use_service/overload1.html /doc/asio/reference/execution_context/use_service/overload2.html -/doc/asio/reference/execution__execute.html -/doc/asio/reference/execution__executor_index/ -/doc/asio/reference/execution__executor_index.html -/doc/asio/reference/execution__executor_index/type.html -/doc/asio/reference/execution__executor_shape/ -/doc/asio/reference/execution__executor_shape.html -/doc/asio/reference/execution__executor_shape/type.html /doc/asio/reference/execution__invocable_archetype/ /doc/asio/reference/execution__invocable_archetype.html /doc/asio/reference/execution__invocable_archetype/operator_lp__rp_.html /doc/asio/reference/execution__is_executor.html -/doc/asio/reference/execution__is_executor_of.html -/doc/asio/reference/execution__is_nothrow_receiver_of.html -/doc/asio/reference/execution__is_operation_state.html -/doc/asio/reference/execution__is_receiver.html -/doc/asio/reference/execution__is_receiver_of.html -/doc/asio/reference/execution__is_scheduler.html -/doc/asio/reference/execution__is_sender.html -/doc/asio/reference/execution__is_sender_to.html -/doc/asio/reference/execution__is_typed_sender.html /doc/asio/reference/execution__mapping.html /doc/asio/reference/execution__mapping_t/ /doc/asio/reference/execution__mapping_t.html @@ -3070,9 +3024,6 @@ /doc/asio/reference/execution__prefer_only/is_preferable.html /doc/asio/reference/execution__prefer_only/is_requirable.html /doc/asio/reference/execution__prefer_only/polymorphic_query_result_type.html -/doc/asio/reference/execution__receiver_invocation_error/ -/doc/asio/reference/execution__receiver_invocation_error.html -/doc/asio/reference/execution__receiver_invocation_error/receiver_invocation_error.html /doc/asio/reference/execution__relationship.html /doc/asio/reference/execution__relationship_t/ /doc/asio/reference/execution__relationship_t/continuation.html @@ -3105,14 +3056,6 @@ /doc/asio/reference/execution__relationship_t/relationship_t/overload1.html /doc/asio/reference/execution__relationship_t/relationship_t/overload2.html /doc/asio/reference/execution__relationship_t/relationship_t/overload3.html -/doc/asio/reference/execution__schedule.html -/doc/asio/reference/execution__sender_base.html -/doc/asio/reference/execution__sender_traits.html -/doc/asio/reference/execution__set_done.html -/doc/asio/reference/execution__set_error.html -/doc/asio/reference/execution__set_value.html -/doc/asio/reference/execution__start.html -/doc/asio/reference/execution__submit.html /doc/asio/reference/executor/ /doc/asio/reference/Executor1.html /doc/asio/reference/executor_arg.html @@ -3196,6 +3139,7 @@ /doc/asio/reference/experimental__as_single.html /doc/asio/reference/experimental__as_single_t/ /doc/asio/reference/experimental__as_single_t/as_default_on.html +/doc/asio/reference/experimental__as_single_t/as_default_on_t.html /doc/asio/reference/experimental__as_single_t/as_single_t/ /doc/asio/reference/experimental__as_single_t/as_single_t.html /doc/asio/reference/experimental__as_single_t/as_single_t/overload1.html @@ -3210,14 +3154,14 @@ /doc/asio/reference/experimental__as_single_t__executor_with_default.html /doc/asio/reference/experimental__as_single_t.html /doc/asio/reference/experimental__as_single_t/token_.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/ -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload1.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload2.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload3.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload4.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload5.html -/doc/asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload6.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/ +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload1.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload2.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload3.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload4.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload5.html +/doc/asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload6.html /doc/asio/reference/experimental__awaitable_operators__operator_pipe__pipe_/ /doc/asio/reference/experimental__awaitable_operators__operator_pipe__pipe_.html /doc/asio/reference/experimental__awaitable_operators__operator_pipe__pipe_/overload1.html @@ -3256,6 +3200,8 @@ /doc/asio/reference/experimental__basic_channel/try_receive.html /doc/asio/reference/experimental__basic_channel/try_send.html /doc/asio/reference/experimental__basic_channel/try_send_n.html +/doc/asio/reference/experimental__basic_channel/try_send_n_via_dispatch.html +/doc/asio/reference/experimental__basic_channel/try_send_via_dispatch.html /doc/asio/reference/experimental__basic_concurrent_channel/ /doc/asio/reference/experimental__basic_concurrent_channel/async_receive.html /doc/asio/reference/experimental__basic_concurrent_channel/async_send.html @@ -3286,6 +3232,9 @@ /doc/asio/reference/experimental__basic_concurrent_channel/try_receive.html /doc/asio/reference/experimental__basic_concurrent_channel/try_send.html /doc/asio/reference/experimental__basic_concurrent_channel/try_send_n.html +/doc/asio/reference/experimental__basic_concurrent_channel/try_send_n_via_dispatch.html +/doc/asio/reference/experimental__basic_concurrent_channel/try_send_via_dispatch.html +/doc/asio/reference/experimental__channel.html /doc/asio/reference/experimental__channel_traits/ /doc/asio/reference/experimental__channel_traits__container/ /doc/asio/reference/experimental__channel_traits__container.html @@ -3299,20 +3248,26 @@ /doc/asio/reference/experimental__channel_traits/receive_cancelled_signature.html /doc/asio/reference/experimental__channel_traits/receive_closed_signature.html /doc/asio/reference/experimental__co_composed.html +/doc/asio/reference/experimental__concurrent_channel.html /doc/asio/reference/experimental__coro/ +/doc/asio/reference/experimental__coro/allocator_type.html /doc/asio/reference/experimental__coro/async_resume/ /doc/asio/reference/experimental__coro/async_resume.html /doc/asio/reference/experimental__coro/async_resume/overload1.html /doc/asio/reference/experimental__coro/async_resume/overload2.html +/doc/asio/reference/experimental__coro/completion_handler.html /doc/asio/reference/experimental__coro/coro/ /doc/asio/reference/experimental__coro/_coro.html /doc/asio/reference/experimental__coro/coro.html /doc/asio/reference/experimental__coro/coro/overload1.html /doc/asio/reference/experimental__coro/coro/overload2.html /doc/asio/reference/experimental__coro/coro/overload3.html +/doc/asio/reference/experimental__coro/error_type.html +/doc/asio/reference/experimental__coro/executor_type.html /doc/asio/reference/experimental__coro/get_allocator.html /doc/asio/reference/experimental__coro/get_executor.html /doc/asio/reference/experimental__coro.html +/doc/asio/reference/experimental__coro/input_type.html /doc/asio/reference/experimental__coro/is_noexcept.html /doc/asio/reference/experimental__coro/is_open.html /doc/asio/reference/experimental__coro/operator_bool.html @@ -3322,9 +3277,22 @@ /doc/asio/reference/experimental__coro/operator_eq_/overload1.html /doc/asio/reference/experimental__coro/operator_eq_/overload2.html /doc/asio/reference/experimental__coro/operator_lp__rp_.html +/doc/asio/reference/experimental__coro/promise_type.html +/doc/asio/reference/experimental__coro/result_type.html +/doc/asio/reference/experimental__coro/return_type.html +/doc/asio/reference/experimental__coro/signature_type.html /doc/asio/reference/experimental__coro_traits/ +/doc/asio/reference/experimental__coro_traits/completion_handler.html +/doc/asio/reference/experimental__coro_traits/error_type.html +/doc/asio/reference/experimental__coro/traits.html /doc/asio/reference/experimental__coro_traits.html +/doc/asio/reference/experimental__coro_traits/input_type.html /doc/asio/reference/experimental__coro_traits/is_noexcept.html +/doc/asio/reference/experimental__coro_traits/result_type.html +/doc/asio/reference/experimental__coro_traits/return_type.html +/doc/asio/reference/experimental__coro_traits/signature_type.html +/doc/asio/reference/experimental__coro_traits/yield_type.html +/doc/asio/reference/experimental__coro/yield_type.html /doc/asio/reference/experimental__co_spawn/ /doc/asio/reference/experimental__co_spawn.html /doc/asio/reference/experimental__co_spawn/overload1.html @@ -3334,14 +3302,18 @@ /doc/asio/reference/experimental__co_spawn/overload5.html /doc/asio/reference/experimental__co_spawn/overload6.html /doc/asio/reference/experimental__error__channel_category.html +/doc/asio/reference/experimental__error__channel_errors__gt_/ +/doc/asio/reference/experimental__error__channel_errors__gt_.html +/doc/asio/reference/experimental__error__channel_errors__gt_/value.html /doc/asio/reference/experimental__error__channel_errors.html /doc/asio/reference/experimental__error__get_channel_category.html /doc/asio/reference/experimental__error__make_error_code.html +/doc/asio/reference/experimental__generator.html /doc/asio/reference/experimental__is_async_operation_range/ /doc/asio/reference/experimental__is_async_operation_range.html /doc/asio/reference/experimental__is_async_operation_range/value.html /doc/asio/reference/experimental__is_promise.html -/doc/asio/reference/experimental__is_promise_lt__promise_lt__Ts_ellipsis__gt__gt_.html +/doc/asio/reference/experimental__is_promise_lt__promise_lt__Ts_ellipsis___gt___gt_.html /doc/asio/reference/experimental__is_promise_v.html /doc/asio/reference/experimental__make_parallel_group/ /doc/asio/reference/experimental__make_parallel_group.html @@ -3364,18 +3336,27 @@ /doc/asio/reference/experimental__promise/promise/overload1.html /doc/asio/reference/experimental__promise/promise/overload2.html /doc/asio/reference/experimental__promise/promise/overload3.html +/doc/asio/reference/experimental__promise_value_type/ +/doc/asio/reference/experimental__promise/value_type.html /doc/asio/reference/experimental__promise_value_type.html +/doc/asio/reference/experimental__promise_value_type_lt__gt_/ /doc/asio/reference/experimental__promise_value_type_lt__gt_.html +/doc/asio/reference/experimental__promise_value_type_lt__gt_/type.html +/doc/asio/reference/experimental__promise_value_type_lt__T__gt_/ /doc/asio/reference/experimental__promise_value_type_lt__T__gt_.html +/doc/asio/reference/experimental__promise_value_type_lt__T__gt_/type.html +/doc/asio/reference/experimental__promise_value_type/type.html /doc/asio/reference/experimental__ranged_parallel_group/ /doc/asio/reference/experimental__ranged_parallel_group/async_wait.html /doc/asio/reference/experimental__ranged_parallel_group.html /doc/asio/reference/experimental__ranged_parallel_group/ranged_parallel_group.html /doc/asio/reference/experimental__ranged_parallel_group/signature.html +/doc/asio/reference/experimental__task.html /doc/asio/reference/experimental__use_coro.html /doc/asio/reference/experimental__use_coro_t/ /doc/asio/reference/experimental__use_coro_t/allocator_type.html /doc/asio/reference/experimental__use_coro_t/as_default_on.html +/doc/asio/reference/experimental__use_coro_t/as_default_on_t.html /doc/asio/reference/experimental__use_coro_t__executor_with_default/ /doc/asio/reference/experimental__use_coro_t__executor_with_default/default_completion_token_type.html /doc/asio/reference/experimental__use_coro_t__executor_with_default/executor_with_default.html @@ -3448,6 +3429,7 @@ /doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload2.html /doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload3.html /doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload4.html +/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload5.html /doc/asio/reference/generic__basic_endpoint/capacity.html /doc/asio/reference/generic__basic_endpoint/data/ /doc/asio/reference/generic__basic_endpoint/data.html @@ -3455,8 +3437,11 @@ /doc/asio/reference/generic__basic_endpoint/data/overload2.html /doc/asio/reference/generic__basic_endpoint/data_type.html /doc/asio/reference/generic__basic_endpoint.html +/doc/asio/reference/generic__basic_endpoint/operator_eq_/ /doc/asio/reference/generic__basic_endpoint/operator_eq__eq_.html /doc/asio/reference/generic__basic_endpoint/operator_eq_.html +/doc/asio/reference/generic__basic_endpoint/operator_eq_/overload1.html +/doc/asio/reference/generic__basic_endpoint/operator_eq_/overload2.html /doc/asio/reference/generic__basic_endpoint/operator_gt__eq_.html /doc/asio/reference/generic__basic_endpoint/operator_gt_.html /doc/asio/reference/generic__basic_endpoint/operator_lt__eq_.html @@ -3577,7 +3562,6 @@ /doc/asio/reference/invalid_service_owner.html /doc/asio/reference/invalid_service_owner/invalid_service_owner.html /doc/asio/reference/io_context/ -/doc/asio/reference/io_context/add_service.html /doc/asio/reference/io_context__basic_executor_type/ /doc/asio/reference/io_context__basic_executor_type/basic_executor_type/ /doc/asio/reference/io_context__basic_executor_type/_basic_executor_type.html @@ -3626,14 +3610,12 @@ /doc/asio/reference/io_context/executor_type.html /doc/asio/reference/io_context/fork_event.html /doc/asio/reference/io_context/get_executor.html -/doc/asio/reference/io_context/has_service.html /doc/asio/reference/io_context.html /doc/asio/reference/io_context/io_context/ /doc/asio/reference/io_context/_io_context.html /doc/asio/reference/io_context/io_context.html /doc/asio/reference/io_context/io_context/overload1.html /doc/asio/reference/io_context/io_context/overload2.html -/doc/asio/reference/io_context/make_service.html /doc/asio/reference/io_context/notify_fork.html /doc/asio/reference/io_context/poll/ /doc/asio/reference/io_context/poll.html @@ -3659,6 +3641,7 @@ /doc/asio/reference/io_context/run/overload2.html /doc/asio/reference/io_context/run_until.html /doc/asio/reference/io_context__service/ +/doc/asio/reference/io_context__service/context.html /doc/asio/reference/io_context__service/get_io_context.html /doc/asio/reference/io_context__service.html /doc/asio/reference/io_context__service/_service.html @@ -3686,10 +3669,7 @@ /doc/asio/reference/io_context__strand/_strand.html /doc/asio/reference/io_context__strand/strand.html /doc/asio/reference/io_context__strand/wrap.html -/doc/asio/reference/io_context/use_service/ /doc/asio/reference/io_context/use_service.html -/doc/asio/reference/io_context/use_service/overload1.html -/doc/asio/reference/io_context/use_service/overload2.html /doc/asio/reference/io_context__work/ /doc/asio/reference/io_context__work/get_io_context.html /doc/asio/reference/io_context__work.html @@ -3709,12 +3689,16 @@ /doc/asio/reference/ip__address/address/overload2.html /doc/asio/reference/ip__address/address/overload3.html /doc/asio/reference/ip__address/address/overload4.html +/doc/asio/reference/ip__address/address/overload5.html /doc/asio/reference/ip__address/from_string/ /doc/asio/reference/ip__address/from_string.html /doc/asio/reference/ip__address/from_string/overload1.html /doc/asio/reference/ip__address/from_string/overload2.html /doc/asio/reference/ip__address/from_string/overload3.html /doc/asio/reference/ip__address/from_string/overload4.html +/doc/asio/reference/ip__address__gt_/ +/doc/asio/reference/ip__address__gt_.html +/doc/asio/reference/ip__address__gt_/operator_lp__rp_.html /doc/asio/reference/ip__address.html /doc/asio/reference/ip__address/is_loopback.html /doc/asio/reference/ip__address/is_multicast.html @@ -3735,6 +3719,7 @@ /doc/asio/reference/ip__address/operator_eq_/overload1.html /doc/asio/reference/ip__address/operator_eq_/overload2.html /doc/asio/reference/ip__address/operator_eq_/overload3.html +/doc/asio/reference/ip__address/operator_eq_/overload4.html /doc/asio/reference/ip__address/operator_gt__eq_.html /doc/asio/reference/ip__address/operator_gt_.html /doc/asio/reference/ip__address/operator_lt__eq_.html @@ -3754,6 +3739,7 @@ /doc/asio/reference/ip__address_v4/address_v4/overload2.html /doc/asio/reference/ip__address_v4/address_v4/overload3.html /doc/asio/reference/ip__address_v4/address_v4/overload4.html +/doc/asio/reference/ip__address_v4/address_v4/overload5.html /doc/asio/reference/ip__address_v4/any.html /doc/asio/reference/ip__address_v4/broadcast/ /doc/asio/reference/ip__address_v4/broadcast.html @@ -3766,6 +3752,9 @@ /doc/asio/reference/ip__address_v4/from_string/overload2.html /doc/asio/reference/ip__address_v4/from_string/overload3.html /doc/asio/reference/ip__address_v4/from_string/overload4.html +/doc/asio/reference/ip__address_v4__gt_/ +/doc/asio/reference/ip__address_v4__gt_.html +/doc/asio/reference/ip__address_v4__gt_/operator_lp__rp_.html /doc/asio/reference/ip__address_v4.html /doc/asio/reference/ip__address_v4/is_class_a.html /doc/asio/reference/ip__address_v4/is_class_b.html @@ -3791,8 +3780,11 @@ /doc/asio/reference/ip__address_v4/make_network_v4/overload1.html /doc/asio/reference/ip__address_v4/make_network_v4/overload2.html /doc/asio/reference/ip__address_v4/netmask.html +/doc/asio/reference/ip__address_v4/operator_eq_/ /doc/asio/reference/ip__address_v4/operator_eq__eq_.html /doc/asio/reference/ip__address_v4/operator_eq_.html +/doc/asio/reference/ip__address_v4/operator_eq_/overload1.html +/doc/asio/reference/ip__address_v4/operator_eq_/overload2.html /doc/asio/reference/ip__address_v4/operator_gt__eq_.html /doc/asio/reference/ip__address_v4/operator_gt_.html /doc/asio/reference/ip__address_v4/operator_lt__eq_.html @@ -3817,6 +3809,7 @@ /doc/asio/reference/ip__address_v6/address_v6/overload1.html /doc/asio/reference/ip__address_v6/address_v6/overload2.html /doc/asio/reference/ip__address_v6/address_v6/overload3.html +/doc/asio/reference/ip__address_v6/address_v6/overload4.html /doc/asio/reference/ip__address_v6/any.html /doc/asio/reference/ip__address_v6/bytes_type.html /doc/asio/reference/ip__address_v6/from_string/ @@ -3825,6 +3818,9 @@ /doc/asio/reference/ip__address_v6/from_string/overload2.html /doc/asio/reference/ip__address_v6/from_string/overload3.html /doc/asio/reference/ip__address_v6/from_string/overload4.html +/doc/asio/reference/ip__address_v6__gt_/ +/doc/asio/reference/ip__address_v6__gt_.html +/doc/asio/reference/ip__address_v6__gt_/operator_lp__rp_.html /doc/asio/reference/ip__address_v6.html /doc/asio/reference/ip__address_v6/is_link_local.html /doc/asio/reference/ip__address_v6/is_loopback.html @@ -3851,8 +3847,11 @@ /doc/asio/reference/ip__address_v6/make_address_v6/overload7.html /doc/asio/reference/ip__address_v6/make_address_v6/overload8.html /doc/asio/reference/ip__address_v6/make_network_v6.html +/doc/asio/reference/ip__address_v6/operator_eq_/ /doc/asio/reference/ip__address_v6/operator_eq__eq_.html /doc/asio/reference/ip__address_v6/operator_eq_.html +/doc/asio/reference/ip__address_v6/operator_eq_/overload1.html +/doc/asio/reference/ip__address_v6/operator_eq_/overload2.html /doc/asio/reference/ip__address_v6/operator_gt__eq_.html /doc/asio/reference/ip__address_v6/operator_gt_.html /doc/asio/reference/ip__address_v6/operator_lt__eq_.html @@ -3883,17 +3882,22 @@ /doc/asio/reference/ip__bad_address_cast/bad_address_cast/overload2.html /doc/asio/reference/ip__bad_address_cast.html /doc/asio/reference/ip__bad_address_cast/what.html +/doc/asio/reference/ip__basic_address_iterator.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/ /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/ /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload1.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload2.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload3.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/difference_type.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/iterator_category.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_arrow_.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_/ /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq__eq_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_/overload1.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_/overload2.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/ /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload1.html @@ -3903,7 +3907,7 @@ /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload1.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload2.html -/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator__star_.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_star_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/pointer.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/reference.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/value_type.html @@ -3912,12 +3916,16 @@ /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload1.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload2.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload3.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/difference_type.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/iterator_category.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_arrow_.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_/ /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq__eq_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_/overload1.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_/overload2.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/ /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload1.html @@ -3927,23 +3935,28 @@ /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload1.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload2.html -/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator__star_.html +/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_star_.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/pointer.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/reference.html /doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/value_type.html +/doc/asio/reference/ip__basic_address_range.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/ /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/ /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload1.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload2.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload3.html +/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload4.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/begin.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/empty.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/end.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/find.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/iterator.html +/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_/ /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_.html +/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_/overload1.html +/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_/overload2.html /doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/size.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/ /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/ @@ -3951,13 +3964,17 @@ /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload1.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload2.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload3.html +/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload4.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/begin.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/empty.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/end.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/find.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_.html /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/iterator.html +/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_/ /doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_.html +/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_/overload1.html +/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_/overload2.html /doc/asio/reference/ip__basic_endpoint/ /doc/asio/reference/ip__basic_endpoint/address/ /doc/asio/reference/ip__basic_endpoint/address.html @@ -3977,6 +3994,9 @@ /doc/asio/reference/ip__basic_endpoint/data/overload2.html /doc/asio/reference/ip__basic_endpoint/data_type.html /doc/asio/reference/ip__basic_endpoint.html +/doc/asio/reference/ip__basic_endpoint_lt__InternetProtocol__gt___gt_/ +/doc/asio/reference/ip__basic_endpoint_lt__InternetProtocol__gt___gt_.html +/doc/asio/reference/ip__basic_endpoint_lt__InternetProtocol__gt___gt_/operator_lp__rp_.html /doc/asio/reference/ip__basic_endpoint/operator_eq_/ /doc/asio/reference/ip__basic_endpoint/operator_eq__eq_.html /doc/asio/reference/ip__basic_endpoint/operator_eq_.html @@ -4064,7 +4084,7 @@ /doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_.html /doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload1.html /doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload2.html -/doc/asio/reference/ip__basic_resolver_iterator/operator__star_.html +/doc/asio/reference/ip__basic_resolver_iterator/operator_star_.html /doc/asio/reference/ip__basic_resolver_iterator/pointer.html /doc/asio/reference/ip__basic_resolver_iterator/reference.html /doc/asio/reference/ip__basic_resolver_iterator/values_.html @@ -4140,22 +4160,16 @@ /doc/asio/reference/ip__basic_resolver_results/max_size.html /doc/asio/reference/ip__basic_resolver_results/operator_arrow_.html /doc/asio/reference/ip__basic_resolver_results/operator_eq_/ -/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/ /doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_.html -/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload1.html -/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload2.html /doc/asio/reference/ip__basic_resolver_results/operator_eq_.html /doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload1.html /doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload2.html -/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/ /doc/asio/reference/ip__basic_resolver_results/operator_not__eq_.html -/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload1.html -/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload2.html /doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/ /doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_.html /doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload1.html /doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload2.html -/doc/asio/reference/ip__basic_resolver_results/operator__star_.html +/doc/asio/reference/ip__basic_resolver_results/operator_star_.html /doc/asio/reference/ip__basic_resolver_results/pointer.html /doc/asio/reference/ip__basic_resolver_results/protocol_type.html /doc/asio/reference/ip__basic_resolver_results/reference.html @@ -4211,8 +4225,12 @@ /doc/asio/reference/ip__network_v4/network_v4/overload2.html /doc/asio/reference/ip__network_v4/network_v4/overload3.html /doc/asio/reference/ip__network_v4/network_v4/overload4.html +/doc/asio/reference/ip__network_v4/network_v4/overload5.html +/doc/asio/reference/ip__network_v4/operator_eq_/ /doc/asio/reference/ip__network_v4/operator_eq__eq_.html /doc/asio/reference/ip__network_v4/operator_eq_.html +/doc/asio/reference/ip__network_v4/operator_eq_/overload1.html +/doc/asio/reference/ip__network_v4/operator_eq_/overload2.html /doc/asio/reference/ip__network_v4/operator_not__eq_.html /doc/asio/reference/ip__network_v4/prefix_length.html /doc/asio/reference/ip__network_v4/to_string/ @@ -4240,8 +4258,12 @@ /doc/asio/reference/ip__network_v6/network_v6/overload1.html /doc/asio/reference/ip__network_v6/network_v6/overload2.html /doc/asio/reference/ip__network_v6/network_v6/overload3.html +/doc/asio/reference/ip__network_v6/network_v6/overload4.html +/doc/asio/reference/ip__network_v6/operator_eq_/ /doc/asio/reference/ip__network_v6/operator_eq__eq_.html /doc/asio/reference/ip__network_v6/operator_eq_.html +/doc/asio/reference/ip__network_v6/operator_eq_/overload1.html +/doc/asio/reference/ip__network_v6/operator_eq_/overload2.html /doc/asio/reference/ip__network_v6/operator_not__eq_.html /doc/asio/reference/ip__network_v6/prefix_length.html /doc/asio/reference/ip__network_v6/to_string/ @@ -4338,6 +4360,7 @@ /doc/asio/reference/local__basic_endpoint/basic_endpoint/overload2.html /doc/asio/reference/local__basic_endpoint/basic_endpoint/overload3.html /doc/asio/reference/local__basic_endpoint/basic_endpoint/overload4.html +/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload5.html /doc/asio/reference/local__basic_endpoint/capacity.html /doc/asio/reference/local__basic_endpoint/data/ /doc/asio/reference/local__basic_endpoint/data.html @@ -4345,8 +4368,11 @@ /doc/asio/reference/local__basic_endpoint/data/overload2.html /doc/asio/reference/local__basic_endpoint/data_type.html /doc/asio/reference/local__basic_endpoint.html +/doc/asio/reference/local__basic_endpoint/operator_eq_/ /doc/asio/reference/local__basic_endpoint/operator_eq__eq_.html /doc/asio/reference/local__basic_endpoint/operator_eq_.html +/doc/asio/reference/local__basic_endpoint/operator_eq_/overload1.html +/doc/asio/reference/local__basic_endpoint/operator_eq_/overload2.html /doc/asio/reference/local__basic_endpoint/operator_gt__eq_.html /doc/asio/reference/local__basic_endpoint/operator_gt_.html /doc/asio/reference/local__basic_endpoint/operator_lt__eq_.html @@ -4459,7 +4485,6 @@ /doc/asio/reference/null_buffers.html /doc/asio/reference/null_buffers/value_type.html /doc/asio/reference/OperationState.html -/doc/asio/reference/operator_lt__lt_.html /doc/asio/reference/operator_pipe_.html /doc/asio/reference/placeholders__bytes_transferred.html /doc/asio/reference/placeholders__endpoint.html @@ -4964,6 +4989,9 @@ /doc/asio/reference/ssl__error__get_stream_category.html /doc/asio/reference/ssl__error__make_error_code.html /doc/asio/reference/ssl__error__stream_category.html +/doc/asio/reference/ssl__error__stream_errors__gt_/ +/doc/asio/reference/ssl__error__stream_errors__gt_.html +/doc/asio/reference/ssl__error__stream_errors__gt_/value.html /doc/asio/reference/ssl__error__stream_errors.html /doc/asio/reference/ssl__host_name_verification/ /doc/asio/reference/ssl__host_name_verification/host_name_verification.html @@ -5096,35 +5124,18 @@ /doc/asio/reference/SyncWriteStream.html /doc/asio/reference/system_category.html /doc/asio/reference/system_context/ -/doc/asio/reference/system_context/add_service.html /doc/asio/reference/system_context/destroy.html /doc/asio/reference/system_context/executor_type.html /doc/asio/reference/system_context/fork_event.html /doc/asio/reference/system_context/get_executor.html -/doc/asio/reference/system_context/has_service.html /doc/asio/reference/system_context.html /doc/asio/reference/system_context/join.html -/doc/asio/reference/system_context/make_service.html /doc/asio/reference/system_context/notify_fork.html /doc/asio/reference/system_context/shutdown.html /doc/asio/reference/system_context/stop.html /doc/asio/reference/system_context/stopped.html /doc/asio/reference/system_context/_system_context.html -/doc/asio/reference/system_context/use_service/ -/doc/asio/reference/system_context/use_service.html -/doc/asio/reference/system_context/use_service/overload1.html -/doc/asio/reference/system_context/use_service/overload2.html -/doc/asio/reference/system_error/ -/doc/asio/reference/system_error/code.html /doc/asio/reference/system_error.html -/doc/asio/reference/system_error/operator_eq_.html -/doc/asio/reference/system_error/system_error/ -/doc/asio/reference/system_error/_system_error.html -/doc/asio/reference/system_error/system_error.html -/doc/asio/reference/system_error/system_error/overload1.html -/doc/asio/reference/system_error/system_error/overload2.html -/doc/asio/reference/system_error/system_error/overload3.html -/doc/asio/reference/system_error/what.html /doc/asio/reference/system_executor.html /doc/asio/reference/system_timer.html /doc/asio/reference/this_coro__cancellation_state.html @@ -5148,7 +5159,6 @@ /doc/asio/reference/thread.html /doc/asio/reference/thread/join.html /doc/asio/reference/thread_pool/ -/doc/asio/reference/thread_pool/add_service.html /doc/asio/reference/thread_pool/attach.html /doc/asio/reference/thread_pool__basic_executor_type/ /doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/ @@ -5156,14 +5166,11 @@ /doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type.html /doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload1.html /doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload2.html -/doc/asio/reference/thread_pool__basic_executor_type/bulk_execute.html -/doc/asio/reference/thread_pool__basic_executor_type/connect.html /doc/asio/reference/thread_pool__basic_executor_type/context.html /doc/asio/reference/thread_pool__basic_executor_type/defer.html /doc/asio/reference/thread_pool__basic_executor_type/dispatch.html /doc/asio/reference/thread_pool__basic_executor_type/execute.html /doc/asio/reference/thread_pool__basic_executor_type.html -/doc/asio/reference/thread_pool__basic_executor_type/index_type.html /doc/asio/reference/thread_pool__basic_executor_type/on_work_finished.html /doc/asio/reference/thread_pool__basic_executor_type/on_work_started.html /doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/ @@ -5185,7 +5192,6 @@ /doc/asio/reference/thread_pool__basic_executor_type/query__static.html /doc/asio/reference/thread_pool__basic_executor_type/query__static/overload1.html /doc/asio/reference/thread_pool__basic_executor_type/query__static/overload2.html -/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload3.html /doc/asio/reference/thread_pool__basic_executor_type/require/ /doc/asio/reference/thread_pool__basic_executor_type/require.html /doc/asio/reference/thread_pool__basic_executor_type/require/overload1.html @@ -5198,21 +5204,14 @@ /doc/asio/reference/thread_pool__basic_executor_type/require/overload8.html /doc/asio/reference/thread_pool__basic_executor_type/require/overload9.html /doc/asio/reference/thread_pool__basic_executor_type/running_in_this_thread.html -/doc/asio/reference/thread_pool__basic_executor_type/schedule.html -/doc/asio/reference/thread_pool__basic_executor_type/sender_type.html -/doc/asio/reference/thread_pool__basic_executor_type/shape_type.html /doc/asio/reference/thread_pool/destroy.html /doc/asio/reference/thread_pool/executor.html /doc/asio/reference/thread_pool/executor_type.html /doc/asio/reference/thread_pool/fork_event.html /doc/asio/reference/thread_pool/get_executor.html -/doc/asio/reference/thread_pool/has_service.html /doc/asio/reference/thread_pool.html /doc/asio/reference/thread_pool/join.html -/doc/asio/reference/thread_pool/make_service.html /doc/asio/reference/thread_pool/notify_fork.html -/doc/asio/reference/thread_pool/scheduler.html -/doc/asio/reference/thread_pool/scheduler_type.html /doc/asio/reference/thread_pool/shutdown.html /doc/asio/reference/thread_pool/stop.html /doc/asio/reference/thread_pool/thread_pool/ @@ -5220,14 +5219,11 @@ /doc/asio/reference/thread_pool/thread_pool.html /doc/asio/reference/thread_pool/thread_pool/overload1.html /doc/asio/reference/thread_pool/thread_pool/overload2.html -/doc/asio/reference/thread_pool/use_service/ -/doc/asio/reference/thread_pool/use_service.html -/doc/asio/reference/thread_pool/use_service/overload1.html -/doc/asio/reference/thread_pool/use_service/overload2.html /doc/asio/reference/thread_pool/wait.html /doc/asio/reference/thread/_thread.html /doc/asio/reference/thread/thread.html /doc/asio/reference/TimeTraits.html +/doc/asio/reference/time_traits.html /doc/asio/reference/time_traits_lt__ptime__gt_/ /doc/asio/reference/time_traits_lt__ptime__gt_/add.html /doc/asio/reference/time_traits_lt__ptime__gt_/duration_type.html @@ -5243,6 +5239,7 @@ /doc/asio/reference/use_awaitable.html /doc/asio/reference/use_awaitable_t/ /doc/asio/reference/use_awaitable_t/as_default_on.html +/doc/asio/reference/use_awaitable_t/as_default_on_t.html /doc/asio/reference/use_awaitable_t__executor_with_default/ /doc/asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html /doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html @@ -5258,7 +5255,10 @@ /doc/asio/reference/use_future_t/get_allocator.html /doc/asio/reference/use_future_t.html /doc/asio/reference/use_future_t/operator_lb__rb_.html +/doc/asio/reference/use_future_t/operator_lp__rp_/ /doc/asio/reference/use_future_t/operator_lp__rp_.html +/doc/asio/reference/use_future_t/operator_lp__rp_/overload1.html +/doc/asio/reference/use_future_t/operator_lp__rp_/overload2.html /doc/asio/reference/use_future_t/rebind.html /doc/asio/reference/use_future_t/use_future_t/ /doc/asio/reference/use_future_t/use_future_t.html @@ -5779,7 +5779,6 @@ /include/asio/detail/buffered_stream_storage.hpp /include/asio/detail/buffer_resize_guard.hpp /include/asio/detail/buffer_sequence_adapter.hpp -/include/asio/detail/bulk_executor_op.hpp /include/asio/detail/call_stack.hpp /include/asio/detail/chrono.hpp /include/asio/detail/chrono_time_traits.hpp @@ -5809,14 +5808,9 @@ /include/asio/detail/fenced_block.hpp /include/asio/detail/functional.hpp /include/asio/detail/future.hpp -/include/asio/detail/gcc_arm_fenced_block.hpp -/include/asio/detail/gcc_hppa_fenced_block.hpp -/include/asio/detail/gcc_sync_fenced_block.hpp -/include/asio/detail/gcc_x86_fenced_block.hpp /include/asio/detail/global.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/handler_tracking.hpp /include/asio/detail/handler_type_requirements.hpp /include/asio/detail/handler_work.hpp @@ -5909,7 +5903,6 @@ /include/asio/detail/kqueue_reactor.hpp /include/asio/detail/limits.hpp /include/asio/detail/local_free_on_block_exit.hpp -/include/asio/detail/macos_fenced_block.hpp /include/asio/detail/memory.hpp /include/asio/detail/mutex.hpp /include/asio/detail/non_const_lvalue.hpp @@ -5981,7 +5974,6 @@ /include/asio/detail/socket_option.hpp /include/asio/detail/socket_select_interrupter.hpp /include/asio/detail/socket_types.hpp -/include/asio/detail/solaris_fenced_block.hpp /include/asio/detail/source_location.hpp /include/asio/detail/static_mutex.hpp /include/asio/detail/std_event.hpp @@ -6008,14 +6000,12 @@ /include/asio/detail/tss_ptr.hpp /include/asio/detail/type_traits.hpp /include/asio/detail/utility.hpp -/include/asio/detail/variadic_templates.hpp /include/asio/detail/wait_handler.hpp /include/asio/detail/wait_op.hpp /include/asio/detail/winapp_thread.hpp /include/asio/detail/wince_thread.hpp /include/asio/detail/win_event.hpp /include/asio/detail/win_fd_set_adapter.hpp -/include/asio/detail/win_fenced_block.hpp /include/asio/detail/win_global.hpp /include/asio/detail/win_iocp_file_service.hpp /include/asio/detail/win_iocp_handle_read_op.hpp @@ -6065,42 +6055,19 @@ /include/asio/execution/bad_executor.hpp /include/asio/execution/blocking_adaptation.hpp /include/asio/execution/blocking.hpp -/include/asio/execution/bulk_execute.hpp -/include/asio/execution/bulk_guarantee.hpp -/include/asio/execution/connect.hpp /include/asio/execution/context_as.hpp /include/asio/execution/context.hpp /include/asio/execution_context.hpp -/include/asio/execution/detail/ -/include/asio/execution/detail/as_invocable.hpp -/include/asio/execution/detail/as_operation.hpp -/include/asio/execution/detail/as_receiver.hpp -/include/asio/execution/detail/bulk_sender.hpp -/include/asio/execution/detail/submit_receiver.hpp -/include/asio/execution/detail/void_receiver.hpp -/include/asio/execution/execute.hpp /include/asio/execution/executor.hpp /include/asio/execution.hpp /include/asio/execution/impl/ /include/asio/execution/impl/bad_executor.ipp -/include/asio/execution/impl/receiver_invocation_error.ipp /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 /include/asio/executor.hpp /include/asio/executor_work_guard.hpp /include/asio/experimental/ @@ -6160,9 +6127,7 @@ /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.hpp /include/asio/impl/ @@ -6187,7 +6152,6 @@ /include/asio/impl/execution_context.ipp /include/asio/impl/executor.hpp /include/asio/impl/executor.ipp -/include/asio/impl/handler_alloc_hook.ipp /include/asio/impl/io_context.hpp /include/asio/impl/io_context.ipp /include/asio/impl/multiple_exceptions.ipp @@ -6349,12 +6313,7 @@ /include/asio/thread_pool.hpp /include/asio/time_traits.hpp /include/asio/traits/ -/include/asio/traits/bulk_execute_free.hpp -/include/asio/traits/bulk_execute_member.hpp -/include/asio/traits/connect_free.hpp -/include/asio/traits/connect_member.hpp /include/asio/traits/equality_comparable.hpp -/include/asio/traits/execute_free.hpp /include/asio/traits/execute_member.hpp /include/asio/traits/prefer_free.hpp /include/asio/traits/prefer_member.hpp @@ -6365,21 +6324,9 @@ /include/asio/traits/require_concept_member.hpp /include/asio/traits/require_free.hpp /include/asio/traits/require_member.hpp -/include/asio/traits/schedule_free.hpp -/include/asio/traits/schedule_member.hpp -/include/asio/traits/set_done_free.hpp -/include/asio/traits/set_done_member.hpp -/include/asio/traits/set_error_free.hpp -/include/asio/traits/set_error_member.hpp -/include/asio/traits/set_value_free.hpp -/include/asio/traits/set_value_member.hpp -/include/asio/traits/start_free.hpp -/include/asio/traits/start_member.hpp /include/asio/traits/static_query.hpp /include/asio/traits/static_require_concept.hpp /include/asio/traits/static_require.hpp -/include/asio/traits/submit_free.hpp -/include/asio/traits/submit_member.hpp /include/asio/ts/ /include/asio/ts/buffer.hpp /include/asio/ts/executor.hpp @@ -7069,28 +7016,14 @@ /src/tests/unit/execution/any_executor.cpp /src/tests/unit/execution/blocking_adaptation.cpp /src/tests/unit/execution/blocking.cpp -/src/tests/unit/execution/bulk_execute.cpp -/src/tests/unit/execution/bulk_guarantee.cpp -/src/tests/unit/execution/connect.cpp /src/tests/unit/execution/context_as.cpp /src/tests/unit/execution_context.cpp -/src/tests/unit/execution/execute.cpp /src/tests/unit/execution/executor.cpp /src/tests/unit/execution/invocable_archetype.cpp /src/tests/unit/execution/mapping.cpp -/src/tests/unit/execution/operation_state.cpp /src/tests/unit/execution/outstanding_work.cpp /src/tests/unit/execution/prefer_only.cpp -/src/tests/unit/execution/receiver.cpp /src/tests/unit/execution/relationship.cpp -/src/tests/unit/execution/schedule.cpp -/src/tests/unit/execution/scheduler.cpp -/src/tests/unit/execution/sender.cpp -/src/tests/unit/execution/set_done.cpp -/src/tests/unit/execution/set_error.cpp -/src/tests/unit/execution/set_value.cpp -/src/tests/unit/execution/start.cpp -/src/tests/unit/execution/submit.cpp /src/tests/unit/executor.cpp /src/tests/unit/executor_work_guard.cpp /src/tests/unit/experimental/ diff --git a/asio/boost_asio.manifest b/asio/boost_asio.manifest index 28a95fe4c8..d193da4981 100644 --- a/asio/boost_asio.manifest +++ b/asio/boost_asio.manifest @@ -72,7 +72,6 @@ /boost/asio/detail/buffered_stream_storage.hpp /boost/asio/detail/buffer_resize_guard.hpp /boost/asio/detail/buffer_sequence_adapter.hpp -/boost/asio/detail/bulk_executor_op.hpp /boost/asio/detail/call_stack.hpp /boost/asio/detail/chrono.hpp /boost/asio/detail/chrono_time_traits.hpp @@ -102,14 +101,9 @@ /boost/asio/detail/fenced_block.hpp /boost/asio/detail/functional.hpp /boost/asio/detail/future.hpp -/boost/asio/detail/gcc_arm_fenced_block.hpp -/boost/asio/detail/gcc_hppa_fenced_block.hpp -/boost/asio/detail/gcc_sync_fenced_block.hpp -/boost/asio/detail/gcc_x86_fenced_block.hpp /boost/asio/detail/global.hpp /boost/asio/detail/handler_alloc_helpers.hpp /boost/asio/detail/handler_cont_helpers.hpp -/boost/asio/detail/handler_invoke_helpers.hpp /boost/asio/detail/handler_tracking.hpp /boost/asio/detail/handler_type_requirements.hpp /boost/asio/detail/handler_work.hpp @@ -202,7 +196,6 @@ /boost/asio/detail/kqueue_reactor.hpp /boost/asio/detail/limits.hpp /boost/asio/detail/local_free_on_block_exit.hpp -/boost/asio/detail/macos_fenced_block.hpp /boost/asio/detail/memory.hpp /boost/asio/detail/mutex.hpp /boost/asio/detail/non_const_lvalue.hpp @@ -274,7 +267,6 @@ /boost/asio/detail/socket_option.hpp /boost/asio/detail/socket_select_interrupter.hpp /boost/asio/detail/socket_types.hpp -/boost/asio/detail/solaris_fenced_block.hpp /boost/asio/detail/source_location.hpp /boost/asio/detail/static_mutex.hpp /boost/asio/detail/std_event.hpp @@ -301,14 +293,12 @@ /boost/asio/detail/tss_ptr.hpp /boost/asio/detail/type_traits.hpp /boost/asio/detail/utility.hpp -/boost/asio/detail/variadic_templates.hpp /boost/asio/detail/wait_handler.hpp /boost/asio/detail/wait_op.hpp /boost/asio/detail/winapp_thread.hpp /boost/asio/detail/wince_thread.hpp /boost/asio/detail/win_event.hpp /boost/asio/detail/win_fd_set_adapter.hpp -/boost/asio/detail/win_fenced_block.hpp /boost/asio/detail/win_global.hpp /boost/asio/detail/win_iocp_file_service.hpp /boost/asio/detail/win_iocp_handle_read_op.hpp @@ -357,42 +347,19 @@ /boost/asio/execution/bad_executor.hpp /boost/asio/execution/blocking_adaptation.hpp /boost/asio/execution/blocking.hpp -/boost/asio/execution/bulk_execute.hpp -/boost/asio/execution/bulk_guarantee.hpp -/boost/asio/execution/connect.hpp /boost/asio/execution/context_as.hpp /boost/asio/execution/context.hpp /boost/asio/execution_context.hpp -/boost/asio/execution/detail/ -/boost/asio/execution/detail/as_invocable.hpp -/boost/asio/execution/detail/as_operation.hpp -/boost/asio/execution/detail/as_receiver.hpp -/boost/asio/execution/detail/bulk_sender.hpp -/boost/asio/execution/detail/submit_receiver.hpp -/boost/asio/execution/detail/void_receiver.hpp -/boost/asio/execution/execute.hpp /boost/asio/execution/executor.hpp /boost/asio/execution.hpp /boost/asio/execution/impl/ /boost/asio/execution/impl/bad_executor.ipp -/boost/asio/execution/impl/receiver_invocation_error.ipp /boost/asio/execution/invocable_archetype.hpp /boost/asio/execution/mapping.hpp /boost/asio/execution/occupancy.hpp -/boost/asio/execution/operation_state.hpp /boost/asio/execution/outstanding_work.hpp /boost/asio/execution/prefer_only.hpp -/boost/asio/execution/receiver.hpp -/boost/asio/execution/receiver_invocation_error.hpp /boost/asio/execution/relationship.hpp -/boost/asio/execution/schedule.hpp -/boost/asio/execution/scheduler.hpp -/boost/asio/execution/sender.hpp -/boost/asio/execution/set_done.hpp -/boost/asio/execution/set_error.hpp -/boost/asio/execution/set_value.hpp -/boost/asio/execution/start.hpp -/boost/asio/execution/submit.hpp /boost/asio/executor.hpp /boost/asio/executor_work_guard.hpp /boost/asio/experimental/ @@ -452,9 +419,7 @@ /boost/asio/generic/raw_protocol.hpp /boost/asio/generic/seq_packet_protocol.hpp /boost/asio/generic/stream_protocol.hpp -/boost/asio/handler_alloc_hook.hpp /boost/asio/handler_continuation_hook.hpp -/boost/asio/handler_invoke_hook.hpp /boost/asio/high_resolution_timer.hpp /boost/asio.hpp /boost/asio/impl/ @@ -478,7 +443,6 @@ /boost/asio/impl/execution_context.ipp /boost/asio/impl/executor.hpp /boost/asio/impl/executor.ipp -/boost/asio/impl/handler_alloc_hook.ipp /boost/asio/impl/io_context.hpp /boost/asio/impl/io_context.ipp /boost/asio/impl/multiple_exceptions.ipp @@ -638,12 +602,7 @@ /boost/asio/thread_pool.hpp /boost/asio/time_traits.hpp /boost/asio/traits/ -/boost/asio/traits/bulk_execute_free.hpp -/boost/asio/traits/bulk_execute_member.hpp -/boost/asio/traits/connect_free.hpp -/boost/asio/traits/connect_member.hpp /boost/asio/traits/equality_comparable.hpp -/boost/asio/traits/execute_free.hpp /boost/asio/traits/execute_member.hpp /boost/asio/traits/prefer_free.hpp /boost/asio/traits/prefer_member.hpp @@ -654,21 +613,9 @@ /boost/asio/traits/require_concept_member.hpp /boost/asio/traits/require_free.hpp /boost/asio/traits/require_member.hpp -/boost/asio/traits/schedule_free.hpp -/boost/asio/traits/schedule_member.hpp -/boost/asio/traits/set_done_free.hpp -/boost/asio/traits/set_done_member.hpp -/boost/asio/traits/set_error_free.hpp -/boost/asio/traits/set_error_member.hpp -/boost/asio/traits/set_value_free.hpp -/boost/asio/traits/set_value_member.hpp -/boost/asio/traits/start_free.hpp -/boost/asio/traits/start_member.hpp /boost/asio/traits/static_query.hpp /boost/asio/traits/static_require_concept.hpp /boost/asio/traits/static_require.hpp -/boost/asio/traits/submit_free.hpp -/boost/asio/traits/submit_member.hpp /boost/asio/ts/ /boost/asio/ts/buffer.hpp /boost/asio/ts/executor.hpp @@ -1279,20 +1226,21 @@ /doc/html/boost_asio/reference/any_completion_handler_allocator/any_completion_handler_allocator.html /doc/html/boost_asio/reference/any_completion_handler_allocator/deallocate.html /doc/html/boost_asio/reference/any_completion_handler_allocator.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/ -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/any_completion_handler_allocator.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/operator_eq__eq_.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/operator_not__eq_.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind/ -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind/other.html -/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_/value_type.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/ +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/any_completion_handler_allocator.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/operator_eq__eq_.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/operator_not__eq_.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind/ +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt___rebind/other.html +/doc/html/boost_asio/reference/any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis___gt_/value_type.html /doc/html/boost_asio/reference/any_completion_handler_allocator/operator_eq__eq_.html /doc/html/boost_asio/reference/any_completion_handler_allocator/operator_not__eq_.html /doc/html/boost_asio/reference/any_completion_handler_allocator__rebind/ /doc/html/boost_asio/reference/any_completion_handler_allocator__rebind.html /doc/html/boost_asio/reference/any_completion_handler_allocator__rebind/other.html +/doc/html/boost_asio/reference/any_completion_handler/allocator_type.html /doc/html/boost_asio/reference/any_completion_handler_allocator/value_type.html /doc/html/boost_asio/reference/any_completion_handler/any_completion_handler/ /doc/html/boost_asio/reference/any_completion_handler/_any_completion_handler.html @@ -1301,6 +1249,7 @@ /doc/html/boost_asio/reference/any_completion_handler/any_completion_handler/overload2.html /doc/html/boost_asio/reference/any_completion_handler/any_completion_handler/overload3.html /doc/html/boost_asio/reference/any_completion_handler/any_completion_handler/overload4.html +/doc/html/boost_asio/reference/any_completion_handler/cancellation_slot_type.html /doc/html/boost_asio/reference/any_completion_handler/get_allocator.html /doc/html/boost_asio/reference/any_completion_handler/get_cancellation_slot.html /doc/html/boost_asio/reference/any_completion_handler.html @@ -1383,18 +1332,12 @@ /doc/html/boost_asio/reference/append_t.html /doc/html/boost_asio/reference/append_t/token_.html /doc/html/boost_asio/reference/append_t/values_.html -/doc/html/boost_asio/reference/asio_handler_allocate.html -/doc/html/boost_asio/reference/asio_handler_deallocate.html -/doc/html/boost_asio/reference/asio_handler_invoke/ -/doc/html/boost_asio/reference/asio_handler_invoke.html -/doc/html/boost_asio/reference/asio_handler_invoke/overload1.html -/doc/html/boost_asio/reference/asio_handler_invoke/overload2.html /doc/html/boost_asio/reference/asio_handler_is_continuation.html /doc/html/boost_asio/reference/associated_allocator/ -/doc/html/boost_asio/reference/associated_allocator/decltype/ -/doc/html/boost_asio/reference/associated_allocator/decltype.html -/doc/html/boost_asio/reference/associated_allocator/decltype/overload1.html -/doc/html/boost_asio/reference/associated_allocator/decltype/overload2.html +/doc/html/boost_asio/reference/associated_allocator/get/ +/doc/html/boost_asio/reference/associated_allocator/get.html +/doc/html/boost_asio/reference/associated_allocator/get/overload1.html +/doc/html/boost_asio/reference/associated_allocator/get/overload2.html /doc/html/boost_asio/reference/associated_allocator.html /doc/html/boost_asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/ /doc/html/boost_asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/get/ @@ -1403,13 +1346,13 @@ /doc/html/boost_asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/get/overload2.html /doc/html/boost_asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_.html /doc/html/boost_asio/reference/associated_allocator_lt__reference_wrapper_lt__T__gt__comma__Allocator__gt_/type.html -/doc/html/boost_asio/reference/associated_allocator/noexcept.html +/doc/html/boost_asio/reference/associated_allocator_t.html /doc/html/boost_asio/reference/associated_allocator/type.html /doc/html/boost_asio/reference/associated_cancellation_slot/ -/doc/html/boost_asio/reference/associated_cancellation_slot/decltype/ -/doc/html/boost_asio/reference/associated_cancellation_slot/decltype.html -/doc/html/boost_asio/reference/associated_cancellation_slot/decltype/overload1.html -/doc/html/boost_asio/reference/associated_cancellation_slot/decltype/overload2.html +/doc/html/boost_asio/reference/associated_cancellation_slot/get/ +/doc/html/boost_asio/reference/associated_cancellation_slot/get.html +/doc/html/boost_asio/reference/associated_cancellation_slot/get/overload1.html +/doc/html/boost_asio/reference/associated_cancellation_slot/get/overload2.html /doc/html/boost_asio/reference/associated_cancellation_slot.html /doc/html/boost_asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/ /doc/html/boost_asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/get/ @@ -1418,13 +1361,13 @@ /doc/html/boost_asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/get/overload2.html /doc/html/boost_asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_.html /doc/html/boost_asio/reference/associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_/type.html -/doc/html/boost_asio/reference/associated_cancellation_slot/noexcept.html +/doc/html/boost_asio/reference/associated_cancellation_slot_t.html /doc/html/boost_asio/reference/associated_cancellation_slot/type.html /doc/html/boost_asio/reference/associated_executor/ -/doc/html/boost_asio/reference/associated_executor/decltype/ -/doc/html/boost_asio/reference/associated_executor/decltype.html -/doc/html/boost_asio/reference/associated_executor/decltype/overload1.html -/doc/html/boost_asio/reference/associated_executor/decltype/overload2.html +/doc/html/boost_asio/reference/associated_executor/get/ +/doc/html/boost_asio/reference/associated_executor/get.html +/doc/html/boost_asio/reference/associated_executor/get/overload1.html +/doc/html/boost_asio/reference/associated_executor/get/overload2.html /doc/html/boost_asio/reference/associated_executor.html /doc/html/boost_asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/ /doc/html/boost_asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/get/ @@ -1433,21 +1376,22 @@ /doc/html/boost_asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/get/overload2.html /doc/html/boost_asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.html /doc/html/boost_asio/reference/associated_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/type.html -/doc/html/boost_asio/reference/associated_executor/noexcept.html +/doc/html/boost_asio/reference/associated_executor_t.html /doc/html/boost_asio/reference/associated_executor/type.html /doc/html/boost_asio/reference/associated_immediate_executor/ -/doc/html/boost_asio/reference/associated_immediate_executor/decltype.html +/doc/html/boost_asio/reference/associated_immediate_executor/get.html /doc/html/boost_asio/reference/associated_immediate_executor.html /doc/html/boost_asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/ /doc/html/boost_asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/get.html /doc/html/boost_asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.html /doc/html/boost_asio/reference/associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_/type.html -/doc/html/boost_asio/reference/associated_immediate_executor/noexcept.html +/doc/html/boost_asio/reference/associated_immediate_executor_t.html /doc/html/boost_asio/reference/associated_immediate_executor/type.html /doc/html/boost_asio/reference/associator.html /doc/html/boost_asio/reference/as_tuple.html /doc/html/boost_asio/reference/as_tuple_t/ /doc/html/boost_asio/reference/as_tuple_t/as_default_on.html +/doc/html/boost_asio/reference/as_tuple_t/as_default_on_t.html /doc/html/boost_asio/reference/as_tuple_t/as_tuple_t/ /doc/html/boost_asio/reference/as_tuple_t/as_tuple_t.html /doc/html/boost_asio/reference/as_tuple_t/as_tuple_t/overload1.html @@ -1868,6 +1812,29 @@ /doc/html/boost_asio/reference/basic_io_object/get_service/overload2.html /doc/html/boost_asio/reference/basic_io_object.html /doc/html/boost_asio/reference/basic_io_object/implementation_type.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/ +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/ +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/_basic_io_object.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/overload1.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/overload2.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/basic_io_object/overload3.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/executor_type.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_executor.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation/ +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation/overload1.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_implementation/overload2.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_io_context.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_io_service.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service/ +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service/overload1.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/get_service/overload2.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/implementation_type.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/operator_eq_.html +/doc/html/boost_asio/reference/basic_io_object_lt__IoObjectService_comma__true__gt_/service_type.html /doc/html/boost_asio/reference/basic_io_object/operator_eq_.html /doc/html/boost_asio/reference/basic_io_object/service_type.html /doc/html/boost_asio/reference/basic_random_access_file/ @@ -3384,11 +3351,7 @@ /doc/html/boost_asio/reference/buffer/overload36.html /doc/html/boost_asio/reference/buffer/overload37.html /doc/html/boost_asio/reference/buffer/overload38.html -/doc/html/boost_asio/reference/buffer/overload39.html /doc/html/boost_asio/reference/buffer/overload3.html -/doc/html/boost_asio/reference/buffer/overload40.html -/doc/html/boost_asio/reference/buffer/overload41.html -/doc/html/boost_asio/reference/buffer/overload42.html /doc/html/boost_asio/reference/buffer/overload4.html /doc/html/boost_asio/reference/buffer/overload5.html /doc/html/boost_asio/reference/buffer/overload6.html @@ -3465,7 +3428,7 @@ /doc/html/boost_asio/reference/buffers_iterator/operator_plus__plus_.html /doc/html/boost_asio/reference/buffers_iterator/operator_plus__plus_/overload1.html /doc/html/boost_asio/reference/buffers_iterator/operator_plus__plus_/overload2.html -/doc/html/boost_asio/reference/buffers_iterator/operator__star_.html +/doc/html/boost_asio/reference/buffers_iterator/operator_star_.html /doc/html/boost_asio/reference/buffers_iterator/pointer.html /doc/html/boost_asio/reference/buffers_iterator/reference.html /doc/html/boost_asio/reference/buffers_iterator/value_type.html @@ -3540,6 +3503,7 @@ /doc/html/boost_asio/reference/CompletionCondition.html /doc/html/boost_asio/reference/completion_signature_of/ /doc/html/boost_asio/reference/completion_signature_of.html +/doc/html/boost_asio/reference/completion_signature_of_t.html /doc/html/boost_asio/reference/completion_signature_of/type.html /doc/html/boost_asio/reference/connect/ /doc/html/boost_asio/reference/ConnectCondition.html @@ -3630,6 +3594,7 @@ /doc/html/boost_asio/reference/deadline_timer.html /doc/html/boost_asio/reference/default_completion_token/ /doc/html/boost_asio/reference/default_completion_token.html +/doc/html/boost_asio/reference/default_completion_token_t.html /doc/html/boost_asio/reference/default_completion_token/type.html /doc/html/boost_asio/reference/defer/ /doc/html/boost_asio/reference/defer.html @@ -3638,30 +3603,43 @@ /doc/html/boost_asio/reference/defer/overload3.html /doc/html/boost_asio/reference/deferred_async_operation/ /doc/html/boost_asio/reference/deferred_async_operation/deferred_async_operation.html -/doc/html/boost_asio/reference/deferred_async_operation/detail__index_sequence_for.html /doc/html/boost_asio/reference/deferred_async_operation.html -/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/ -/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/deferred_async_operation.html -/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/detail__index_sequence_for.html -/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_.html -/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis__gt__comma__Initiation_comma__InitArgs_ellipsis__gt_/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/ +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/deferred_async_operation.html +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_.html +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_/ +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/deferred_async_operation_lt__deferred_signatures_lt__Signatures_ellipsis___gt__comma__Initiation_comma__InitArgs_ellipsis___gt_/operator_lp__rp_/overload2.html +/doc/html/boost_asio/reference/deferred_async_operation/operator_lp__rp_/ /doc/html/boost_asio/reference/deferred_async_operation/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_async_operation/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/deferred_async_operation/operator_lp__rp_/overload2.html /doc/html/boost_asio/reference/deferred_conditional/ /doc/html/boost_asio/reference/deferred_conditional/deferred_conditional.html /doc/html/boost_asio/reference/deferred_conditional.html +/doc/html/boost_asio/reference/deferred_conditional/operator_lp__rp_/ /doc/html/boost_asio/reference/deferred_conditional/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_conditional/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/deferred_conditional/operator_lp__rp_/overload2.html /doc/html/boost_asio/reference/deferred_conditional/otherwise.html /doc/html/boost_asio/reference/deferred_conditional/then.html /doc/html/boost_asio/reference/deferred_function/ /doc/html/boost_asio/reference/deferred_function/deferred_function.html /doc/html/boost_asio/reference/deferred_function/function_.html /doc/html/boost_asio/reference/deferred_function.html +/doc/html/boost_asio/reference/deferred_function/operator_lp__rp_/ /doc/html/boost_asio/reference/deferred_function/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_function/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/deferred_function/operator_lp__rp_/overload2.html /doc/html/boost_asio/reference/deferred.html /doc/html/boost_asio/reference/deferred_init_tag.html /doc/html/boost_asio/reference/deferred_noop/ /doc/html/boost_asio/reference/deferred_noop.html +/doc/html/boost_asio/reference/deferred_noop/operator_lp__rp_/ /doc/html/boost_asio/reference/deferred_noop/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_noop/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/deferred_noop/operator_lp__rp_/overload2.html /doc/html/boost_asio/reference/deferred_sequence/ /doc/html/boost_asio/reference/deferred_sequence/deferred_sequence.html /doc/html/boost_asio/reference/deferred_sequence.html @@ -3672,6 +3650,7 @@ /doc/html/boost_asio/reference/deferred_signatures.html /doc/html/boost_asio/reference/deferred_t/ /doc/html/boost_asio/reference/deferred_t/as_default_on.html +/doc/html/boost_asio/reference/deferred_t/as_default_on_t.html /doc/html/boost_asio/reference/deferred_t/deferred_t.html /doc/html/boost_asio/reference/deferred_t__executor_with_default/ /doc/html/boost_asio/reference/deferred_t__executor_with_default/default_completion_token_type.html @@ -3686,15 +3665,18 @@ /doc/html/boost_asio/reference/deferred_t/when.html /doc/html/boost_asio/reference/deferred_values/ /doc/html/boost_asio/reference/deferred_values/deferred_values.html -/doc/html/boost_asio/reference/deferred_values/detail__index_sequence_for.html /doc/html/boost_asio/reference/deferred_values.html /doc/html/boost_asio/reference/deferred_values__initiate/ /doc/html/boost_asio/reference/deferred_values__initiate.html /doc/html/boost_asio/reference/deferred_values__initiate/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_values/operator_lp__rp_/ /doc/html/boost_asio/reference/deferred_values/operator_lp__rp_.html +/doc/html/boost_asio/reference/deferred_values/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/deferred_values/operator_lp__rp_/overload2.html /doc/html/boost_asio/reference/detached.html /doc/html/boost_asio/reference/detached_t/ /doc/html/boost_asio/reference/detached_t/as_default_on.html +/doc/html/boost_asio/reference/detached_t/as_default_on_t.html /doc/html/boost_asio/reference/detached_t/detached_t.html /doc/html/boost_asio/reference/detached_t__executor_with_default/ /doc/html/boost_asio/reference/detached_t__executor_with_default/default_completion_token_type.html @@ -3920,62 +3902,6 @@ /doc/html/boost_asio/reference/execution__blocking_t__possibly_t/polymorphic_query_result_type.html /doc/html/boost_asio/reference/execution__blocking_t__possibly_t/possibly_t.html /doc/html/boost_asio/reference/execution__blocking_t__possibly_t/value.html -/doc/html/boost_asio/reference/execution__bulk_execute.html -/doc/html/boost_asio/reference/execution__bulk_guarantee.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/ -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/ -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload1.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload2.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload3.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload4.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/is_applicable_property_v.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/is_preferable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/is_requirable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/operator_eq__eq_.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/operator_not__eq_.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/parallel.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/ -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/is_applicable_property_v.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/is_preferable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/is_requirable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/parallel_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/polymorphic_query_result_type.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__parallel_t/value.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/polymorphic_query_result_type.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/sequenced.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/ -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/is_applicable_property_v.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/is_preferable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/is_requirable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/polymorphic_query_result_type.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/sequenced_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__sequenced_t/value.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t/unsequenced.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/ -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_applicable_property_v.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_preferable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_requirable.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/polymorphic_query_result_type.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/unsequenced_t.html -/doc/html/boost_asio/reference/execution__bulk_guarantee_t__unsequenced_t/value.html -/doc/html/boost_asio/reference/execution__can_bulk_execute.html -/doc/html/boost_asio/reference/execution__can_connect.html -/doc/html/boost_asio/reference/execution__can_execute.html -/doc/html/boost_asio/reference/execution__can_schedule.html -/doc/html/boost_asio/reference/execution__can_set_done.html -/doc/html/boost_asio/reference/execution__can_set_error.html -/doc/html/boost_asio/reference/execution__can_set_value.html -/doc/html/boost_asio/reference/execution__can_start.html -/doc/html/boost_asio/reference/execution__can_submit.html -/doc/html/boost_asio/reference/execution__connect.html -/doc/html/boost_asio/reference/execution__connect_result/ -/doc/html/boost_asio/reference/execution__connect_result.html -/doc/html/boost_asio/reference/execution__connect_result/type.html /doc/html/boost_asio/reference/execution_context/ /doc/html/boost_asio/reference/execution_context/add_service.html /doc/html/boost_asio/reference/execution__context_as.html @@ -4016,26 +3942,10 @@ /doc/html/boost_asio/reference/execution_context/use_service.html /doc/html/boost_asio/reference/execution_context/use_service/overload1.html /doc/html/boost_asio/reference/execution_context/use_service/overload2.html -/doc/html/boost_asio/reference/execution__execute.html -/doc/html/boost_asio/reference/execution__executor_index/ -/doc/html/boost_asio/reference/execution__executor_index.html -/doc/html/boost_asio/reference/execution__executor_index/type.html -/doc/html/boost_asio/reference/execution__executor_shape/ -/doc/html/boost_asio/reference/execution__executor_shape.html -/doc/html/boost_asio/reference/execution__executor_shape/type.html /doc/html/boost_asio/reference/execution__invocable_archetype/ /doc/html/boost_asio/reference/execution__invocable_archetype.html /doc/html/boost_asio/reference/execution__invocable_archetype/operator_lp__rp_.html /doc/html/boost_asio/reference/execution__is_executor.html -/doc/html/boost_asio/reference/execution__is_executor_of.html -/doc/html/boost_asio/reference/execution__is_nothrow_receiver_of.html -/doc/html/boost_asio/reference/execution__is_operation_state.html -/doc/html/boost_asio/reference/execution__is_receiver.html -/doc/html/boost_asio/reference/execution__is_receiver_of.html -/doc/html/boost_asio/reference/execution__is_scheduler.html -/doc/html/boost_asio/reference/execution__is_sender.html -/doc/html/boost_asio/reference/execution__is_sender_to.html -/doc/html/boost_asio/reference/execution__is_typed_sender.html /doc/html/boost_asio/reference/execution__mapping.html /doc/html/boost_asio/reference/execution__mapping_t/ /doc/html/boost_asio/reference/execution__mapping_t.html @@ -4123,9 +4033,6 @@ /doc/html/boost_asio/reference/execution__prefer_only/is_preferable.html /doc/html/boost_asio/reference/execution__prefer_only/is_requirable.html /doc/html/boost_asio/reference/execution__prefer_only/polymorphic_query_result_type.html -/doc/html/boost_asio/reference/execution__receiver_invocation_error/ -/doc/html/boost_asio/reference/execution__receiver_invocation_error.html -/doc/html/boost_asio/reference/execution__receiver_invocation_error/receiver_invocation_error.html /doc/html/boost_asio/reference/execution__relationship.html /doc/html/boost_asio/reference/execution__relationship_t/ /doc/html/boost_asio/reference/execution__relationship_t/continuation.html @@ -4158,14 +4065,6 @@ /doc/html/boost_asio/reference/execution__relationship_t/relationship_t/overload1.html /doc/html/boost_asio/reference/execution__relationship_t/relationship_t/overload2.html /doc/html/boost_asio/reference/execution__relationship_t/relationship_t/overload3.html -/doc/html/boost_asio/reference/execution__schedule.html -/doc/html/boost_asio/reference/execution__sender_base.html -/doc/html/boost_asio/reference/execution__sender_traits.html -/doc/html/boost_asio/reference/execution__set_done.html -/doc/html/boost_asio/reference/execution__set_error.html -/doc/html/boost_asio/reference/execution__set_value.html -/doc/html/boost_asio/reference/execution__start.html -/doc/html/boost_asio/reference/execution__submit.html /doc/html/boost_asio/reference/executor/ /doc/html/boost_asio/reference/Executor1.html /doc/html/boost_asio/reference/executor_arg.html @@ -4249,6 +4148,7 @@ /doc/html/boost_asio/reference/experimental__as_single.html /doc/html/boost_asio/reference/experimental__as_single_t/ /doc/html/boost_asio/reference/experimental__as_single_t/as_default_on.html +/doc/html/boost_asio/reference/experimental__as_single_t/as_default_on_t.html /doc/html/boost_asio/reference/experimental__as_single_t/as_single_t/ /doc/html/boost_asio/reference/experimental__as_single_t/as_single_t.html /doc/html/boost_asio/reference/experimental__as_single_t/as_single_t/overload1.html @@ -4263,14 +4163,14 @@ /doc/html/boost_asio/reference/experimental__as_single_t__executor_with_default.html /doc/html/boost_asio/reference/experimental__as_single_t.html /doc/html/boost_asio/reference/experimental__as_single_t/token_.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/ -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload1.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload2.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload3.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload4.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload5.html -/doc/html/boost_asio/reference/experimental__awaitable_operators__operator__amp__amp_/overload6.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/ +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload1.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload2.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload3.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload4.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload5.html +/doc/html/boost_asio/reference/experimental__awaitable_operators__operator_amp__amp_/overload6.html /doc/html/boost_asio/reference/experimental__awaitable_operators__operator_pipe__pipe_/ /doc/html/boost_asio/reference/experimental__awaitable_operators__operator_pipe__pipe_.html /doc/html/boost_asio/reference/experimental__awaitable_operators__operator_pipe__pipe_/overload1.html @@ -4309,6 +4209,8 @@ /doc/html/boost_asio/reference/experimental__basic_channel/try_receive.html /doc/html/boost_asio/reference/experimental__basic_channel/try_send.html /doc/html/boost_asio/reference/experimental__basic_channel/try_send_n.html +/doc/html/boost_asio/reference/experimental__basic_channel/try_send_n_via_dispatch.html +/doc/html/boost_asio/reference/experimental__basic_channel/try_send_via_dispatch.html /doc/html/boost_asio/reference/experimental__basic_concurrent_channel/ /doc/html/boost_asio/reference/experimental__basic_concurrent_channel/async_receive.html /doc/html/boost_asio/reference/experimental__basic_concurrent_channel/async_send.html @@ -4339,6 +4241,9 @@ /doc/html/boost_asio/reference/experimental__basic_concurrent_channel/try_receive.html /doc/html/boost_asio/reference/experimental__basic_concurrent_channel/try_send.html /doc/html/boost_asio/reference/experimental__basic_concurrent_channel/try_send_n.html +/doc/html/boost_asio/reference/experimental__basic_concurrent_channel/try_send_n_via_dispatch.html +/doc/html/boost_asio/reference/experimental__basic_concurrent_channel/try_send_via_dispatch.html +/doc/html/boost_asio/reference/experimental__channel.html /doc/html/boost_asio/reference/experimental__channel_traits/ /doc/html/boost_asio/reference/experimental__channel_traits__container/ /doc/html/boost_asio/reference/experimental__channel_traits__container.html @@ -4352,20 +4257,26 @@ /doc/html/boost_asio/reference/experimental__channel_traits/receive_cancelled_signature.html /doc/html/boost_asio/reference/experimental__channel_traits/receive_closed_signature.html /doc/html/boost_asio/reference/experimental__co_composed.html +/doc/html/boost_asio/reference/experimental__concurrent_channel.html /doc/html/boost_asio/reference/experimental__coro/ +/doc/html/boost_asio/reference/experimental__coro/allocator_type.html /doc/html/boost_asio/reference/experimental__coro/async_resume/ /doc/html/boost_asio/reference/experimental__coro/async_resume.html /doc/html/boost_asio/reference/experimental__coro/async_resume/overload1.html /doc/html/boost_asio/reference/experimental__coro/async_resume/overload2.html +/doc/html/boost_asio/reference/experimental__coro/completion_handler.html /doc/html/boost_asio/reference/experimental__coro/coro/ /doc/html/boost_asio/reference/experimental__coro/_coro.html /doc/html/boost_asio/reference/experimental__coro/coro.html /doc/html/boost_asio/reference/experimental__coro/coro/overload1.html /doc/html/boost_asio/reference/experimental__coro/coro/overload2.html /doc/html/boost_asio/reference/experimental__coro/coro/overload3.html +/doc/html/boost_asio/reference/experimental__coro/error_type.html +/doc/html/boost_asio/reference/experimental__coro/executor_type.html /doc/html/boost_asio/reference/experimental__coro/get_allocator.html /doc/html/boost_asio/reference/experimental__coro/get_executor.html /doc/html/boost_asio/reference/experimental__coro.html +/doc/html/boost_asio/reference/experimental__coro/input_type.html /doc/html/boost_asio/reference/experimental__coro/is_noexcept.html /doc/html/boost_asio/reference/experimental__coro/is_open.html /doc/html/boost_asio/reference/experimental__coro/operator_bool.html @@ -4375,9 +4286,22 @@ /doc/html/boost_asio/reference/experimental__coro/operator_eq_/overload1.html /doc/html/boost_asio/reference/experimental__coro/operator_eq_/overload2.html /doc/html/boost_asio/reference/experimental__coro/operator_lp__rp_.html +/doc/html/boost_asio/reference/experimental__coro/promise_type.html +/doc/html/boost_asio/reference/experimental__coro/result_type.html +/doc/html/boost_asio/reference/experimental__coro/return_type.html +/doc/html/boost_asio/reference/experimental__coro/signature_type.html /doc/html/boost_asio/reference/experimental__coro_traits/ +/doc/html/boost_asio/reference/experimental__coro_traits/completion_handler.html +/doc/html/boost_asio/reference/experimental__coro_traits/error_type.html +/doc/html/boost_asio/reference/experimental__coro/traits.html /doc/html/boost_asio/reference/experimental__coro_traits.html +/doc/html/boost_asio/reference/experimental__coro_traits/input_type.html /doc/html/boost_asio/reference/experimental__coro_traits/is_noexcept.html +/doc/html/boost_asio/reference/experimental__coro_traits/result_type.html +/doc/html/boost_asio/reference/experimental__coro_traits/return_type.html +/doc/html/boost_asio/reference/experimental__coro_traits/signature_type.html +/doc/html/boost_asio/reference/experimental__coro_traits/yield_type.html +/doc/html/boost_asio/reference/experimental__coro/yield_type.html /doc/html/boost_asio/reference/experimental__co_spawn/ /doc/html/boost_asio/reference/experimental__co_spawn.html /doc/html/boost_asio/reference/experimental__co_spawn/overload1.html @@ -4390,11 +4314,12 @@ /doc/html/boost_asio/reference/experimental__error__channel_errors.html /doc/html/boost_asio/reference/experimental__error__get_channel_category.html /doc/html/boost_asio/reference/experimental__error__make_error_code.html +/doc/html/boost_asio/reference/experimental__generator.html /doc/html/boost_asio/reference/experimental__is_async_operation_range/ /doc/html/boost_asio/reference/experimental__is_async_operation_range.html /doc/html/boost_asio/reference/experimental__is_async_operation_range/value.html /doc/html/boost_asio/reference/experimental__is_promise.html -/doc/html/boost_asio/reference/experimental__is_promise_lt__promise_lt__Ts_ellipsis__gt__gt_.html +/doc/html/boost_asio/reference/experimental__is_promise_lt__promise_lt__Ts_ellipsis___gt___gt_.html /doc/html/boost_asio/reference/experimental__is_promise_v.html /doc/html/boost_asio/reference/experimental__make_parallel_group/ /doc/html/boost_asio/reference/experimental__make_parallel_group.html @@ -4417,18 +4342,27 @@ /doc/html/boost_asio/reference/experimental__promise/promise/overload1.html /doc/html/boost_asio/reference/experimental__promise/promise/overload2.html /doc/html/boost_asio/reference/experimental__promise/promise/overload3.html +/doc/html/boost_asio/reference/experimental__promise_value_type/ +/doc/html/boost_asio/reference/experimental__promise/value_type.html /doc/html/boost_asio/reference/experimental__promise_value_type.html +/doc/html/boost_asio/reference/experimental__promise_value_type_lt__gt_/ /doc/html/boost_asio/reference/experimental__promise_value_type_lt__gt_.html +/doc/html/boost_asio/reference/experimental__promise_value_type_lt__gt_/type.html +/doc/html/boost_asio/reference/experimental__promise_value_type_lt__T__gt_/ /doc/html/boost_asio/reference/experimental__promise_value_type_lt__T__gt_.html +/doc/html/boost_asio/reference/experimental__promise_value_type_lt__T__gt_/type.html +/doc/html/boost_asio/reference/experimental__promise_value_type/type.html /doc/html/boost_asio/reference/experimental__ranged_parallel_group/ /doc/html/boost_asio/reference/experimental__ranged_parallel_group/async_wait.html /doc/html/boost_asio/reference/experimental__ranged_parallel_group.html /doc/html/boost_asio/reference/experimental__ranged_parallel_group/ranged_parallel_group.html /doc/html/boost_asio/reference/experimental__ranged_parallel_group/signature.html +/doc/html/boost_asio/reference/experimental__task.html /doc/html/boost_asio/reference/experimental__use_coro.html /doc/html/boost_asio/reference/experimental__use_coro_t/ /doc/html/boost_asio/reference/experimental__use_coro_t/allocator_type.html /doc/html/boost_asio/reference/experimental__use_coro_t/as_default_on.html +/doc/html/boost_asio/reference/experimental__use_coro_t/as_default_on_t.html /doc/html/boost_asio/reference/experimental__use_coro_t__executor_with_default/ /doc/html/boost_asio/reference/experimental__use_coro_t__executor_with_default/default_completion_token_type.html /doc/html/boost_asio/reference/experimental__use_coro_t__executor_with_default/executor_with_default.html @@ -4501,6 +4435,7 @@ /doc/html/boost_asio/reference/generic__basic_endpoint/basic_endpoint/overload2.html /doc/html/boost_asio/reference/generic__basic_endpoint/basic_endpoint/overload3.html /doc/html/boost_asio/reference/generic__basic_endpoint/basic_endpoint/overload4.html +/doc/html/boost_asio/reference/generic__basic_endpoint/basic_endpoint/overload5.html /doc/html/boost_asio/reference/generic__basic_endpoint/capacity.html /doc/html/boost_asio/reference/generic__basic_endpoint/data/ /doc/html/boost_asio/reference/generic__basic_endpoint/data.html @@ -4508,8 +4443,11 @@ /doc/html/boost_asio/reference/generic__basic_endpoint/data/overload2.html /doc/html/boost_asio/reference/generic__basic_endpoint/data_type.html /doc/html/boost_asio/reference/generic__basic_endpoint.html +/doc/html/boost_asio/reference/generic__basic_endpoint/operator_eq_/ /doc/html/boost_asio/reference/generic__basic_endpoint/operator_eq__eq_.html /doc/html/boost_asio/reference/generic__basic_endpoint/operator_eq_.html +/doc/html/boost_asio/reference/generic__basic_endpoint/operator_eq_/overload1.html +/doc/html/boost_asio/reference/generic__basic_endpoint/operator_eq_/overload2.html /doc/html/boost_asio/reference/generic__basic_endpoint/operator_gt__eq_.html /doc/html/boost_asio/reference/generic__basic_endpoint/operator_gt_.html /doc/html/boost_asio/reference/generic__basic_endpoint/operator_lt__eq_.html @@ -4630,7 +4568,6 @@ /doc/html/boost_asio/reference/invalid_service_owner.html /doc/html/boost_asio/reference/invalid_service_owner/invalid_service_owner.html /doc/html/boost_asio/reference/io_context/ -/doc/html/boost_asio/reference/io_context/add_service.html /doc/html/boost_asio/reference/io_context__basic_executor_type/ /doc/html/boost_asio/reference/io_context__basic_executor_type/basic_executor_type/ /doc/html/boost_asio/reference/io_context__basic_executor_type/_basic_executor_type.html @@ -4679,14 +4616,12 @@ /doc/html/boost_asio/reference/io_context/executor_type.html /doc/html/boost_asio/reference/io_context/fork_event.html /doc/html/boost_asio/reference/io_context/get_executor.html -/doc/html/boost_asio/reference/io_context/has_service.html /doc/html/boost_asio/reference/io_context.html /doc/html/boost_asio/reference/io_context/io_context/ /doc/html/boost_asio/reference/io_context/_io_context.html /doc/html/boost_asio/reference/io_context/io_context.html /doc/html/boost_asio/reference/io_context/io_context/overload1.html /doc/html/boost_asio/reference/io_context/io_context/overload2.html -/doc/html/boost_asio/reference/io_context/make_service.html /doc/html/boost_asio/reference/io_context/notify_fork.html /doc/html/boost_asio/reference/io_context/poll/ /doc/html/boost_asio/reference/io_context/poll.html @@ -4712,6 +4647,7 @@ /doc/html/boost_asio/reference/io_context/run/overload2.html /doc/html/boost_asio/reference/io_context/run_until.html /doc/html/boost_asio/reference/io_context__service/ +/doc/html/boost_asio/reference/io_context__service/context.html /doc/html/boost_asio/reference/io_context__service/get_io_context.html /doc/html/boost_asio/reference/io_context__service.html /doc/html/boost_asio/reference/io_context__service/_service.html @@ -4739,10 +4675,7 @@ /doc/html/boost_asio/reference/io_context__strand/_strand.html /doc/html/boost_asio/reference/io_context__strand/strand.html /doc/html/boost_asio/reference/io_context__strand/wrap.html -/doc/html/boost_asio/reference/io_context/use_service/ /doc/html/boost_asio/reference/io_context/use_service.html -/doc/html/boost_asio/reference/io_context/use_service/overload1.html -/doc/html/boost_asio/reference/io_context/use_service/overload2.html /doc/html/boost_asio/reference/io_context__work/ /doc/html/boost_asio/reference/io_context__work/get_io_context.html /doc/html/boost_asio/reference/io_context__work.html @@ -4762,12 +4695,16 @@ /doc/html/boost_asio/reference/ip__address/address/overload2.html /doc/html/boost_asio/reference/ip__address/address/overload3.html /doc/html/boost_asio/reference/ip__address/address/overload4.html +/doc/html/boost_asio/reference/ip__address/address/overload5.html /doc/html/boost_asio/reference/ip__address/from_string/ /doc/html/boost_asio/reference/ip__address/from_string.html /doc/html/boost_asio/reference/ip__address/from_string/overload1.html /doc/html/boost_asio/reference/ip__address/from_string/overload2.html /doc/html/boost_asio/reference/ip__address/from_string/overload3.html /doc/html/boost_asio/reference/ip__address/from_string/overload4.html +/doc/html/boost_asio/reference/ip__address__gt_/ +/doc/html/boost_asio/reference/ip__address__gt_.html +/doc/html/boost_asio/reference/ip__address__gt_/operator_lp__rp_.html /doc/html/boost_asio/reference/ip__address.html /doc/html/boost_asio/reference/ip__address/is_loopback.html /doc/html/boost_asio/reference/ip__address/is_multicast.html @@ -4788,6 +4725,7 @@ /doc/html/boost_asio/reference/ip__address/operator_eq_/overload1.html /doc/html/boost_asio/reference/ip__address/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__address/operator_eq_/overload3.html +/doc/html/boost_asio/reference/ip__address/operator_eq_/overload4.html /doc/html/boost_asio/reference/ip__address/operator_gt__eq_.html /doc/html/boost_asio/reference/ip__address/operator_gt_.html /doc/html/boost_asio/reference/ip__address/operator_lt__eq_.html @@ -4807,6 +4745,7 @@ /doc/html/boost_asio/reference/ip__address_v4/address_v4/overload2.html /doc/html/boost_asio/reference/ip__address_v4/address_v4/overload3.html /doc/html/boost_asio/reference/ip__address_v4/address_v4/overload4.html +/doc/html/boost_asio/reference/ip__address_v4/address_v4/overload5.html /doc/html/boost_asio/reference/ip__address_v4/any.html /doc/html/boost_asio/reference/ip__address_v4/broadcast/ /doc/html/boost_asio/reference/ip__address_v4/broadcast.html @@ -4819,6 +4758,9 @@ /doc/html/boost_asio/reference/ip__address_v4/from_string/overload2.html /doc/html/boost_asio/reference/ip__address_v4/from_string/overload3.html /doc/html/boost_asio/reference/ip__address_v4/from_string/overload4.html +/doc/html/boost_asio/reference/ip__address_v4__gt_/ +/doc/html/boost_asio/reference/ip__address_v4__gt_.html +/doc/html/boost_asio/reference/ip__address_v4__gt_/operator_lp__rp_.html /doc/html/boost_asio/reference/ip__address_v4.html /doc/html/boost_asio/reference/ip__address_v4/is_class_a.html /doc/html/boost_asio/reference/ip__address_v4/is_class_b.html @@ -4844,8 +4786,11 @@ /doc/html/boost_asio/reference/ip__address_v4/make_network_v4/overload1.html /doc/html/boost_asio/reference/ip__address_v4/make_network_v4/overload2.html /doc/html/boost_asio/reference/ip__address_v4/netmask.html +/doc/html/boost_asio/reference/ip__address_v4/operator_eq_/ /doc/html/boost_asio/reference/ip__address_v4/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__address_v4/operator_eq_.html +/doc/html/boost_asio/reference/ip__address_v4/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__address_v4/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__address_v4/operator_gt__eq_.html /doc/html/boost_asio/reference/ip__address_v4/operator_gt_.html /doc/html/boost_asio/reference/ip__address_v4/operator_lt__eq_.html @@ -4870,6 +4815,7 @@ /doc/html/boost_asio/reference/ip__address_v6/address_v6/overload1.html /doc/html/boost_asio/reference/ip__address_v6/address_v6/overload2.html /doc/html/boost_asio/reference/ip__address_v6/address_v6/overload3.html +/doc/html/boost_asio/reference/ip__address_v6/address_v6/overload4.html /doc/html/boost_asio/reference/ip__address_v6/any.html /doc/html/boost_asio/reference/ip__address_v6/bytes_type.html /doc/html/boost_asio/reference/ip__address_v6/from_string/ @@ -4878,6 +4824,9 @@ /doc/html/boost_asio/reference/ip__address_v6/from_string/overload2.html /doc/html/boost_asio/reference/ip__address_v6/from_string/overload3.html /doc/html/boost_asio/reference/ip__address_v6/from_string/overload4.html +/doc/html/boost_asio/reference/ip__address_v6__gt_/ +/doc/html/boost_asio/reference/ip__address_v6__gt_.html +/doc/html/boost_asio/reference/ip__address_v6__gt_/operator_lp__rp_.html /doc/html/boost_asio/reference/ip__address_v6.html /doc/html/boost_asio/reference/ip__address_v6/is_link_local.html /doc/html/boost_asio/reference/ip__address_v6/is_loopback.html @@ -4904,8 +4853,11 @@ /doc/html/boost_asio/reference/ip__address_v6/make_address_v6/overload7.html /doc/html/boost_asio/reference/ip__address_v6/make_address_v6/overload8.html /doc/html/boost_asio/reference/ip__address_v6/make_network_v6.html +/doc/html/boost_asio/reference/ip__address_v6/operator_eq_/ /doc/html/boost_asio/reference/ip__address_v6/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__address_v6/operator_eq_.html +/doc/html/boost_asio/reference/ip__address_v6/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__address_v6/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__address_v6/operator_gt__eq_.html /doc/html/boost_asio/reference/ip__address_v6/operator_gt_.html /doc/html/boost_asio/reference/ip__address_v6/operator_lt__eq_.html @@ -4936,17 +4888,22 @@ /doc/html/boost_asio/reference/ip__bad_address_cast/bad_address_cast/overload2.html /doc/html/boost_asio/reference/ip__bad_address_cast.html /doc/html/boost_asio/reference/ip__bad_address_cast/what.html +/doc/html/boost_asio/reference/ip__basic_address_iterator.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload1.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload2.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload3.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/difference_type.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/iterator_category.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_arrow_.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_/ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload1.html @@ -4956,7 +4913,7 @@ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload1.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload2.html -/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator__star_.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_star_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/pointer.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/reference.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/value_type.html @@ -4965,12 +4922,16 @@ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload1.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload2.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload3.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/difference_type.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/iterator_category.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_arrow_.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_/ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload1.html @@ -4980,23 +4941,28 @@ /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload1.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload2.html -/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator__star_.html +/doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_star_.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/pointer.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/reference.html /doc/html/boost_asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/value_type.html +/doc/html/boost_asio/reference/ip__basic_address_range.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/ /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/ /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload1.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload2.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload3.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload4.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/begin.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/empty.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/end.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/find.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/iterator.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_/ /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v4__gt_/size.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/ /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/ @@ -5004,13 +4970,17 @@ /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload1.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload2.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload3.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload4.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/begin.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/empty.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/end.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/find.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_.html /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/iterator.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_/ /doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__basic_endpoint/ /doc/html/boost_asio/reference/ip__basic_endpoint/address/ /doc/html/boost_asio/reference/ip__basic_endpoint/address.html @@ -5030,6 +5000,9 @@ /doc/html/boost_asio/reference/ip__basic_endpoint/data/overload2.html /doc/html/boost_asio/reference/ip__basic_endpoint/data_type.html /doc/html/boost_asio/reference/ip__basic_endpoint.html +/doc/html/boost_asio/reference/ip__basic_endpoint_lt__InternetProtocol__gt___gt_/ +/doc/html/boost_asio/reference/ip__basic_endpoint_lt__InternetProtocol__gt___gt_.html +/doc/html/boost_asio/reference/ip__basic_endpoint_lt__InternetProtocol__gt___gt_/operator_lp__rp_.html /doc/html/boost_asio/reference/ip__basic_endpoint/operator_eq_/ /doc/html/boost_asio/reference/ip__basic_endpoint/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__basic_endpoint/operator_eq_.html @@ -5117,7 +5090,7 @@ /doc/html/boost_asio/reference/ip__basic_resolver_iterator/operator_plus__plus_.html /doc/html/boost_asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload1.html /doc/html/boost_asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload2.html -/doc/html/boost_asio/reference/ip__basic_resolver_iterator/operator__star_.html +/doc/html/boost_asio/reference/ip__basic_resolver_iterator/operator_star_.html /doc/html/boost_asio/reference/ip__basic_resolver_iterator/pointer.html /doc/html/boost_asio/reference/ip__basic_resolver_iterator/reference.html /doc/html/boost_asio/reference/ip__basic_resolver_iterator/values_.html @@ -5193,22 +5166,16 @@ /doc/html/boost_asio/reference/ip__basic_resolver_results/max_size.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_arrow_.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq_/ -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq__eq_/ /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq__eq_.html -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload1.html -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload2.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq_.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq_/overload1.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_eq_/overload2.html -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_not__eq_/ /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_not__eq_.html -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_not__eq_/overload1.html -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_not__eq_/overload2.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_plus__plus_/ /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_plus__plus_.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload1.html /doc/html/boost_asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload2.html -/doc/html/boost_asio/reference/ip__basic_resolver_results/operator__star_.html +/doc/html/boost_asio/reference/ip__basic_resolver_results/operator_star_.html /doc/html/boost_asio/reference/ip__basic_resolver_results/pointer.html /doc/html/boost_asio/reference/ip__basic_resolver_results/protocol_type.html /doc/html/boost_asio/reference/ip__basic_resolver_results/reference.html @@ -5264,8 +5231,12 @@ /doc/html/boost_asio/reference/ip__network_v4/network_v4/overload2.html /doc/html/boost_asio/reference/ip__network_v4/network_v4/overload3.html /doc/html/boost_asio/reference/ip__network_v4/network_v4/overload4.html +/doc/html/boost_asio/reference/ip__network_v4/network_v4/overload5.html +/doc/html/boost_asio/reference/ip__network_v4/operator_eq_/ /doc/html/boost_asio/reference/ip__network_v4/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__network_v4/operator_eq_.html +/doc/html/boost_asio/reference/ip__network_v4/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__network_v4/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__network_v4/operator_not__eq_.html /doc/html/boost_asio/reference/ip__network_v4/prefix_length.html /doc/html/boost_asio/reference/ip__network_v4/to_string/ @@ -5293,8 +5264,12 @@ /doc/html/boost_asio/reference/ip__network_v6/network_v6/overload1.html /doc/html/boost_asio/reference/ip__network_v6/network_v6/overload2.html /doc/html/boost_asio/reference/ip__network_v6/network_v6/overload3.html +/doc/html/boost_asio/reference/ip__network_v6/network_v6/overload4.html +/doc/html/boost_asio/reference/ip__network_v6/operator_eq_/ /doc/html/boost_asio/reference/ip__network_v6/operator_eq__eq_.html /doc/html/boost_asio/reference/ip__network_v6/operator_eq_.html +/doc/html/boost_asio/reference/ip__network_v6/operator_eq_/overload1.html +/doc/html/boost_asio/reference/ip__network_v6/operator_eq_/overload2.html /doc/html/boost_asio/reference/ip__network_v6/operator_not__eq_.html /doc/html/boost_asio/reference/ip__network_v6/prefix_length.html /doc/html/boost_asio/reference/ip__network_v6/to_string/ @@ -5412,6 +5387,7 @@ /doc/html/boost_asio/reference/local__basic_endpoint/basic_endpoint/overload2.html /doc/html/boost_asio/reference/local__basic_endpoint/basic_endpoint/overload3.html /doc/html/boost_asio/reference/local__basic_endpoint/basic_endpoint/overload4.html +/doc/html/boost_asio/reference/local__basic_endpoint/basic_endpoint/overload5.html /doc/html/boost_asio/reference/local__basic_endpoint/capacity.html /doc/html/boost_asio/reference/local__basic_endpoint/data/ /doc/html/boost_asio/reference/local__basic_endpoint/data.html @@ -5419,8 +5395,11 @@ /doc/html/boost_asio/reference/local__basic_endpoint/data/overload2.html /doc/html/boost_asio/reference/local__basic_endpoint/data_type.html /doc/html/boost_asio/reference/local__basic_endpoint.html +/doc/html/boost_asio/reference/local__basic_endpoint/operator_eq_/ /doc/html/boost_asio/reference/local__basic_endpoint/operator_eq__eq_.html /doc/html/boost_asio/reference/local__basic_endpoint/operator_eq_.html +/doc/html/boost_asio/reference/local__basic_endpoint/operator_eq_/overload1.html +/doc/html/boost_asio/reference/local__basic_endpoint/operator_eq_/overload2.html /doc/html/boost_asio/reference/local__basic_endpoint/operator_gt__eq_.html /doc/html/boost_asio/reference/local__basic_endpoint/operator_gt_.html /doc/html/boost_asio/reference/local__basic_endpoint/operator_lt__eq_.html @@ -6168,24 +6147,17 @@ /doc/html/boost_asio/reference/SyncReadStream.html /doc/html/boost_asio/reference/SyncWriteStream.html /doc/html/boost_asio/reference/system_context/ -/doc/html/boost_asio/reference/system_context/add_service.html /doc/html/boost_asio/reference/system_context/destroy.html /doc/html/boost_asio/reference/system_context/executor_type.html /doc/html/boost_asio/reference/system_context/fork_event.html /doc/html/boost_asio/reference/system_context/get_executor.html -/doc/html/boost_asio/reference/system_context/has_service.html /doc/html/boost_asio/reference/system_context.html /doc/html/boost_asio/reference/system_context/join.html -/doc/html/boost_asio/reference/system_context/make_service.html /doc/html/boost_asio/reference/system_context/notify_fork.html /doc/html/boost_asio/reference/system_context/shutdown.html /doc/html/boost_asio/reference/system_context/stop.html /doc/html/boost_asio/reference/system_context/stopped.html /doc/html/boost_asio/reference/system_context/_system_context.html -/doc/html/boost_asio/reference/system_context/use_service/ -/doc/html/boost_asio/reference/system_context/use_service.html -/doc/html/boost_asio/reference/system_context/use_service/overload1.html -/doc/html/boost_asio/reference/system_context/use_service/overload2.html /doc/html/boost_asio/reference/system_executor.html /doc/html/boost_asio/reference/system_timer.html /doc/html/boost_asio/reference/this_coro__cancellation_state.html @@ -6206,7 +6178,6 @@ /doc/html/boost_asio/reference/this_coro__throw_if_cancelled/overload1.html /doc/html/boost_asio/reference/this_coro__throw_if_cancelled/overload2.html /doc/html/boost_asio/reference/thread_pool/ -/doc/html/boost_asio/reference/thread_pool/add_service.html /doc/html/boost_asio/reference/thread_pool/attach.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/ /doc/html/boost_asio/reference/thread_pool__basic_executor_type/basic_executor_type/ @@ -6214,14 +6185,11 @@ /doc/html/boost_asio/reference/thread_pool__basic_executor_type/basic_executor_type.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload1.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload2.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/bulk_execute.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/connect.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/context.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/defer.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/dispatch.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/execute.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/index_type.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/on_work_finished.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/on_work_started.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/operator_eq_/ @@ -6243,7 +6211,6 @@ /doc/html/boost_asio/reference/thread_pool__basic_executor_type/query__static.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/query__static/overload1.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/query__static/overload2.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/query__static/overload3.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/require/ /doc/html/boost_asio/reference/thread_pool__basic_executor_type/require.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/require/overload1.html @@ -6256,21 +6223,14 @@ /doc/html/boost_asio/reference/thread_pool__basic_executor_type/require/overload8.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/require/overload9.html /doc/html/boost_asio/reference/thread_pool__basic_executor_type/running_in_this_thread.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/schedule.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/sender_type.html -/doc/html/boost_asio/reference/thread_pool__basic_executor_type/shape_type.html /doc/html/boost_asio/reference/thread_pool/destroy.html /doc/html/boost_asio/reference/thread_pool/executor.html /doc/html/boost_asio/reference/thread_pool/executor_type.html /doc/html/boost_asio/reference/thread_pool/fork_event.html /doc/html/boost_asio/reference/thread_pool/get_executor.html -/doc/html/boost_asio/reference/thread_pool/has_service.html /doc/html/boost_asio/reference/thread_pool.html /doc/html/boost_asio/reference/thread_pool/join.html -/doc/html/boost_asio/reference/thread_pool/make_service.html /doc/html/boost_asio/reference/thread_pool/notify_fork.html -/doc/html/boost_asio/reference/thread_pool/scheduler.html -/doc/html/boost_asio/reference/thread_pool/scheduler_type.html /doc/html/boost_asio/reference/thread_pool/shutdown.html /doc/html/boost_asio/reference/thread_pool/stop.html /doc/html/boost_asio/reference/thread_pool/thread_pool/ @@ -6278,12 +6238,9 @@ /doc/html/boost_asio/reference/thread_pool/thread_pool.html /doc/html/boost_asio/reference/thread_pool/thread_pool/overload1.html /doc/html/boost_asio/reference/thread_pool/thread_pool/overload2.html -/doc/html/boost_asio/reference/thread_pool/use_service/ -/doc/html/boost_asio/reference/thread_pool/use_service.html -/doc/html/boost_asio/reference/thread_pool/use_service/overload1.html -/doc/html/boost_asio/reference/thread_pool/use_service/overload2.html /doc/html/boost_asio/reference/thread_pool/wait.html /doc/html/boost_asio/reference/TimeTraits.html +/doc/html/boost_asio/reference/time_traits.html /doc/html/boost_asio/reference/time_traits_lt__ptime__gt_/ /doc/html/boost_asio/reference/time_traits_lt__ptime__gt_/add.html /doc/html/boost_asio/reference/time_traits_lt__ptime__gt_/duration_type.html @@ -6299,6 +6256,7 @@ /doc/html/boost_asio/reference/use_awaitable.html /doc/html/boost_asio/reference/use_awaitable_t/ /doc/html/boost_asio/reference/use_awaitable_t/as_default_on.html +/doc/html/boost_asio/reference/use_awaitable_t/as_default_on_t.html /doc/html/boost_asio/reference/use_awaitable_t__executor_with_default/ /doc/html/boost_asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html /doc/html/boost_asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html @@ -6314,7 +6272,10 @@ /doc/html/boost_asio/reference/use_future_t/get_allocator.html /doc/html/boost_asio/reference/use_future_t.html /doc/html/boost_asio/reference/use_future_t/operator_lb__rb_.html +/doc/html/boost_asio/reference/use_future_t/operator_lp__rp_/ /doc/html/boost_asio/reference/use_future_t/operator_lp__rp_.html +/doc/html/boost_asio/reference/use_future_t/operator_lp__rp_/overload1.html +/doc/html/boost_asio/reference/use_future_t/operator_lp__rp_/overload2.html /doc/html/boost_asio/reference/use_future_t/rebind.html /doc/html/boost_asio/reference/use_future_t/use_future_t/ /doc/html/boost_asio/reference/use_future_t/use_future_t.html @@ -7310,29 +7271,15 @@ /libs/asio/test/execution/any_executor.cpp /libs/asio/test/execution/blocking_adaptation.cpp /libs/asio/test/execution/blocking.cpp -/libs/asio/test/execution/bulk_execute.cpp -/libs/asio/test/execution/bulk_guarantee.cpp -/libs/asio/test/execution/connect.cpp /libs/asio/test/execution/context_as.cpp /libs/asio/test/execution_context.cpp -/libs/asio/test/execution/execute.cpp /libs/asio/test/execution/executor.cpp /libs/asio/test/execution/invocable_archetype.cpp /libs/asio/test/execution/Jamfile.v2 /libs/asio/test/execution/mapping.cpp -/libs/asio/test/execution/operation_state.cpp /libs/asio/test/execution/outstanding_work.cpp /libs/asio/test/execution/prefer_only.cpp -/libs/asio/test/execution/receiver.cpp /libs/asio/test/execution/relationship.cpp -/libs/asio/test/execution/schedule.cpp -/libs/asio/test/execution/scheduler.cpp -/libs/asio/test/execution/sender.cpp -/libs/asio/test/execution/set_done.cpp -/libs/asio/test/execution/set_error.cpp -/libs/asio/test/execution/set_value.cpp -/libs/asio/test/execution/start.cpp -/libs/asio/test/execution/submit.cpp /libs/asio/test/executor.cpp /libs/asio/test/executor_work_guard.cpp /libs/asio/test/experimental/ diff --git a/asio/configure.ac b/asio/configure.ac index 3cc187c47e..3908366c2f 100644 --- a/asio/configure.ac +++ b/asio/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(asio, [1.28.2]) +AC_INIT(asio, [1.29.0]) AC_CONFIG_SRCDIR(include/asio.hpp) AM_MAINTAINER_MODE AM_INIT_AUTOMAKE([tar-pax]) diff --git a/asio/include/asio/version.hpp b/asio/include/asio/version.hpp index 070f551486..e876d0da95 100644 --- a/asio/include/asio/version.hpp +++ b/asio/include/asio/version.hpp @@ -18,6 +18,6 @@ // ASIO_VERSION % 100 is the sub-minor version // ASIO_VERSION / 100 % 1000 is the minor version // ASIO_VERSION / 100000 is the major version -#define ASIO_VERSION 102802 // 1.28.2 +#define ASIO_VERSION 102900 // 1.29.0 #endif // ASIO_VERSION_HPP From 654be18b9acd9f06f9cc65dc8799c309898a8246 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 5 Dec 2023 19:24:52 +1100 Subject: [PATCH 05/10] Add missing nothrow constructors to asio::executor. Fixes compatibility between asio::any_completion_handler and ASIO_USE_TS_EXECUTOR_AS_DEFAULT. --- asio/include/asio/executor.hpp | 20 ++++++++++++++++++++ asio/include/asio/impl/executor.hpp | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/asio/include/asio/executor.hpp b/asio/include/asio/executor.hpp index ba4b72eb15..45c4337144 100644 --- a/asio/include/asio/executor.hpp +++ b/asio/include/asio/executor.hpp @@ -19,6 +19,7 @@ #if !defined(ASIO_NO_TS_EXECUTORS) +#include #include #include "asio/detail/cstddef.hpp" #include "asio/detail/executor_function.hpp" @@ -76,6 +77,25 @@ class executor template executor(Executor e); + /// Construct a polymorphic executor that points to the same target as + /// another polymorphic executor. + executor(std::nothrow_t, const executor& other) noexcept + : impl_(other.clone()) + { + } + + /// Construct a polymorphic executor that moves the target from another + /// polymorphic executor. + executor(std::nothrow_t, executor&& other) noexcept + : impl_(other.impl_) + { + other.impl_ = 0; + } + + /// Construct a polymorphic wrapper for the specified executor. + template + executor(std::nothrow_t, Executor e) noexcept; + /// Allocator-aware constructor to create a polymorphic wrapper for the /// specified executor. template diff --git a/asio/include/asio/impl/executor.hpp b/asio/include/asio/impl/executor.hpp index 9cabc05dc8..0393ac3584 100644 --- a/asio/include/asio/impl/executor.hpp +++ b/asio/include/asio/impl/executor.hpp @@ -19,6 +19,7 @@ #if !defined(ASIO_NO_TS_EXECUTORS) +#include #include "asio/detail/atomic_count.hpp" #include "asio/detail/global.hpp" #include "asio/detail/memory.hpp" @@ -47,6 +48,11 @@ class executor::impl return p; } + static impl_base* create(std::nothrow_t, const Executor& e) noexcept + { + return new (std::nothrow) impl(e, std::allocator()); + } + impl(const Executor& e, const Allocator& a) noexcept : impl_base(false), ref_count_(1), @@ -167,6 +173,11 @@ class executor::impl return &detail::global> >(); } + static impl_base* create(std::nothrow_t, const system_executor&) noexcept + { + return &detail::global> >(); + } + impl() : impl_base(true) { @@ -244,6 +255,12 @@ executor::executor(Executor e) { } +template +executor::executor(std::nothrow_t, Executor e) noexcept + : impl_(impl>::create(std::nothrow, e)) +{ +} + template executor::executor(allocator_arg_t, const Allocator& a, Executor e) : impl_(impl::create(e, a)) From 23b6a4be1fbb68cd42c0c7fa2ca79fb880f930f7 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 5 Dec 2023 19:48:37 +1100 Subject: [PATCH 06/10] Prevent any_completion_handler's associators from crashing if there is no target. --- asio/include/asio/any_completion_handler.hpp | 26 ++++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/asio/include/asio/any_completion_handler.hpp b/asio/include/asio/any_completion_handler.hpp index dc61d4d90e..2234df3c52 100644 --- a/asio/include/asio/any_completion_handler.hpp +++ b/asio/include/asio/any_completion_handler.hpp @@ -514,9 +514,15 @@ class any_completion_handler_allocator /// Allocate space for @c n objects of the allocator's value type. T* allocate(std::size_t n) const { - return static_cast( - fn_table_->allocate( - impl_, sizeof(T) * n, alignof(T))); + if (fn_table_) + { + return static_cast( + fn_table_->allocate( + impl_, sizeof(T) * n, alignof(T))); + } + std::bad_alloc ex; + asio::detail::throw_exception(ex); + return nullptr; } /// Deallocate space for @c n objects of the allocator's value type. @@ -724,7 +730,7 @@ class any_completion_handler /// Get the associated cancellation slot. cancellation_slot_type get_cancellation_slot() const noexcept { - return impl_->get_cancellation_slot(); + return impl_ ? impl_->get_cancellation_slot() : cancellation_slot_type(); } /// Function call operator. @@ -786,8 +792,10 @@ struct associated_executor, Candidate> static type get(const any_completion_handler& handler, const Candidate& candidate = Candidate()) noexcept { - return handler.fn_table_->executor(handler.impl_, - any_completion_executor(std::nothrow, candidate)); + any_completion_executor any_candidate(std::nothrow, candidate); + return handler.fn_table_ + ? handler.fn_table_->executor(handler.impl_, any_candidate) + : any_candidate; } }; @@ -800,8 +808,10 @@ struct associated_immediate_executor< static type get(const any_completion_handler& handler, const Candidate& candidate = Candidate()) noexcept { - return handler.fn_table_->immediate_executor(handler.impl_, - any_io_executor(std::nothrow, candidate)); + any_io_executor any_candidate(std::nothrow, candidate); + return handler.fn_table_ + ? handler.fn_table_->immediate_executor(handler.impl_, any_candidate) + : any_candidate; } }; From 75aabc12651fb41a9cbde23c83260baad80119a1 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 5 Dec 2023 20:02:21 +1100 Subject: [PATCH 07/10] Fix async_handshake compatibility with default completion tokens. --- asio/include/asio/ssl/stream.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/asio/include/asio/ssl/stream.hpp b/asio/include/asio/ssl/stream.hpp index 5b1cb95bfa..1629ed3b82 100644 --- a/asio/include/asio/ssl/stream.hpp +++ b/asio/include/asio/ssl/stream.hpp @@ -18,6 +18,7 @@ #include "asio/detail/config.hpp" #include "asio/async_result.hpp" +#include "asio/buffer.hpp" #include "asio/detail/buffer_sequence_adapter.hpp" #include "asio/detail/handler_type_requirements.hpp" #include "asio/detail/non_const_lvalue.hpp" @@ -559,7 +560,10 @@ class stream : = default_completion_token_t> auto async_handshake(handshake_type type, const ConstBufferSequence& buffers, BufferedHandshakeToken&& token - = default_completion_token_t()) + = default_completion_token_t(), + constraint_t< + is_const_buffer_sequence::value + > = 0) -> decltype( async_initiate( From 8e78c2f81788d524ae170c9c394520429f0e0ac7 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 5 Dec 2023 21:05:33 +1100 Subject: [PATCH 08/10] Remove leading space from code snippets. --- asio/src/doc/reference.xsl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/asio/src/doc/reference.xsl b/asio/src/doc/reference.xsl index e6b0780b91..a1bb5a7604 100644 --- a/asio/src/doc/reference.xsl +++ b/asio/src/doc/reference.xsl @@ -445,10 +445,20 @@ + + + - + + + + + + + + - + From 79e2ba77b970d7f0bf70f4480f24d8462d037199 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 5 Dec 2023 21:22:19 +1100 Subject: [PATCH 09/10] Fix tutorial links. --- asio/src/doc/tutorial.xsl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/asio/src/doc/tutorial.xsl b/asio/src/doc/tutorial.xsl index df9a2e2040..6fcbbe57e1 100644 --- a/asio/src/doc/tutorial.xsl +++ b/asio/src/doc/tutorial.xsl @@ -340,6 +340,11 @@ + + [link asio.tutorial + + ] + [link asio.overview.model.async_ops @@ -394,12 +399,7 @@ - - [link asio.tutorial - - ] - - + From ed5db1b50136bace796062c1a6eab0df9a74f8fa Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Wed, 6 Dec 2023 20:19:35 +1100 Subject: [PATCH 10/10] Migrate remaining c++03 examples to c++11. --- asio/boostify.pl | 70 +-- asio/configure.ac | 1 - asio/release.pl | 22 - asio/src/Makefile.am | 6 - asio/src/Makefile.mgw | 159 +++--- asio/src/Makefile.msc | 251 ++++----- asio/src/doc/examples.qbk | 525 ++++++------------ asio/src/doc/overview/allocation.qbk | 1 - asio/src/doc/overview/buffers.qbk | 1 - asio/src/doc/overview/coroutine.qbk | 2 +- asio/src/doc/overview/iostreams.qbk | 2 +- asio/src/doc/overview/line_based.qbk | 2 +- asio/src/doc/overview/posix.qbk | 5 +- asio/src/doc/overview/protocols.qbk | 2 +- asio/src/doc/overview/reactor.qbk | 2 +- asio/src/doc/overview/signals.qbk | 1 - asio/src/doc/overview/spawn.qbk | 1 - asio/src/doc/overview/ssl.qbk | 1 - asio/src/doc/overview/strands.qbk | 2 +- asio/src/doc/tutorial.dox | 6 +- asio/src/examples/cpp03/Makefile.am | 251 --------- asio/src/examples/cpp03/allocation/server.cpp | 242 -------- asio/src/examples/cpp03/buffers/.gitignore | 10 - .../cpp03/buffers/reference_counted.cpp | 131 ----- asio/src/examples/cpp03/chat/chat_client.cpp | 177 ------ asio/src/examples/cpp03/chat/chat_message.hpp | 96 ---- asio/src/examples/cpp03/chat/chat_server.cpp | 249 --------- .../examples/cpp03/chat/posix_chat_client.cpp | 204 ------- .../cpp03/echo/async_tcp_echo_server.cpp | 137 ----- .../cpp03/echo/async_udp_echo_server.cpp | 92 --- .../cpp03/echo/blocking_tcp_echo_client.cpp | 59 -- .../cpp03/echo/blocking_tcp_echo_server.cpp | 79 --- .../cpp03/echo/blocking_udp_echo_client.cpp | 59 -- .../cpp03/echo/blocking_udp_echo_server.cpp | 53 -- asio/src/examples/cpp03/fork/.gitignore | 11 - asio/src/examples/cpp03/fork/daemon.cpp | 190 ------- .../cpp03/fork/process_per_connection.cpp | 161 ------ .../examples/cpp03/http/server/connection.cpp | 99 ---- .../examples/cpp03/http/server/connection.hpp | 83 --- .../cpp03/http/server/connection_manager.cpp | 38 -- .../cpp03/http/server/connection_manager.hpp | 44 -- .../src/examples/cpp03/http/server/header.hpp | 28 - asio/src/examples/cpp03/http/server/main.cpp | 44 -- .../examples/cpp03/http/server/mime_types.cpp | 46 -- .../examples/cpp03/http/server/mime_types.hpp | 27 - asio/src/examples/cpp03/http/server/reply.cpp | 256 --------- asio/src/examples/cpp03/http/server/reply.hpp | 64 --- .../src/examples/cpp03/http/server/server.cpp | 94 ---- .../src/examples/cpp03/http/server/server.hpp | 69 --- .../examples/cpp03/http/server2/.gitignore | 11 - .../cpp03/http/server2/connection.cpp | 93 ---- .../examples/cpp03/http/server3/.gitignore | 11 - .../cpp03/http/server3/connection.cpp | 94 ---- .../examples/cpp03/http/server4/.gitignore | 11 - .../examples/cpp03/http/server4/request.hpp | 46 -- .../cpp03/http/server4/request_parser.cpp | 226 -------- .../cpp03/http/server4/request_parser.hpp | 78 --- asio/src/examples/cpp03/invocation/.gitignore | 10 - .../cpp03/invocation/prioritised_handlers.cpp | 171 ------ asio/src/examples/cpp03/iostreams/.gitignore | 11 - .../examples/cpp03/iostreams/http_client.cpp | 91 --- asio/src/examples/cpp03/local/.gitignore | 13 - .../src/examples/cpp03/local/connect_pair.cpp | 141 ----- .../examples/cpp03/local/iostream_client.cpp | 62 --- .../examples/cpp03/local/stream_client.cpp | 61 -- .../examples/cpp03/local/stream_server.cpp | 141 ----- asio/src/examples/cpp03/multicast/.gitignore | 11 - .../src/examples/cpp03/multicast/receiver.cpp | 93 ---- asio/src/examples/cpp03/multicast/sender.cpp | 98 ---- .../src/examples/cpp03/nonblocking/.gitignore | 10 - .../cpp03/nonblocking/third_party_lib.cpp | 240 -------- asio/src/examples/cpp03/socks4/.gitignore | 10 - asio/src/examples/cpp03/socks4/socks4.hpp | 144 ----- .../src/examples/cpp03/socks4/sync_client.cpp | 94 ---- asio/src/examples/cpp03/spawn/.gitignore | 12 - asio/src/examples/cpp03/spawn/echo_server.cpp | 126 ----- .../examples/cpp03/spawn/parallel_grep.cpp | 93 ---- asio/src/examples/cpp03/ssl/.gitignore | 11 - asio/src/examples/cpp03/ssl/README | 8 - asio/src/examples/cpp03/ssl/ca.pem | 50 -- asio/src/examples/cpp03/ssl/client.cpp | 157 ------ asio/src/examples/cpp03/ssl/dh4096.pem | 25 - asio/src/examples/cpp03/ssl/server.cpp | 170 ------ asio/src/examples/cpp03/ssl/server.pem | 99 ---- asio/src/examples/cpp03/timeouts/.gitignore | 11 - .../cpp03/timeouts/async_tcp_client.cpp | 311 ----------- .../cpp03/timeouts/blocking_tcp_client.cpp | 191 ------- .../timeouts/blocking_token_tcp_client.cpp | 201 ------- .../cpp03/timeouts/blocking_udp_client.cpp | 154 ----- asio/src/examples/cpp03/timeouts/server.cpp | 433 --------------- asio/src/examples/cpp03/timers/.gitignore | 10 - .../examples/cpp03/timers/time_t_timer.cpp | 106 ---- asio/src/examples/cpp03/windows/.gitignore | 10 - asio/src/examples/cpp11/Makefile.am | 145 ++++- .../examples/cpp11/chat/posix_chat_client.cpp | 198 +++++++ .../cpp11/echo/blocking_tcp_echo_server.cpp | 4 +- .../cpp11/files/blocking_file_copy.cpp | 2 +- .../handler_tracking/custom_tracking.hpp | 4 +- .../{cpp03 => cpp11}/http/client/.gitignore | 0 .../http/client/async_client.cpp | 28 +- .../http/client/sync_client.cpp | 4 +- .../http/doc_root/data_1K.html | 0 .../http/doc_root/data_2K.html | 0 .../http/doc_root/data_4K.html | 0 .../http/doc_root/data_8K.html | 0 .../examples/cpp11/http/server/connection.cpp | 3 +- .../examples/cpp11/http/server/connection.hpp | 2 +- .../chat => cpp11/http/server2}/.gitignore | 0 .../cpp11/http/server2/connection.cpp | 89 +++ .../http/server2/connection.hpp | 32 +- .../{cpp03 => cpp11}/http/server2/header.hpp | 0 .../http/server2/io_context_pool.cpp | 13 +- .../http/server2/io_context_pool.hpp | 9 +- .../{cpp03 => cpp11}/http/server2/main.cpp | 4 +- .../http/server2/mime_types.cpp | 0 .../http/server2/mime_types.hpp | 0 .../{cpp03 => cpp11}/http/server2/reply.cpp | 3 +- .../{cpp03 => cpp11}/http/server2/reply.hpp | 0 .../{cpp03 => cpp11}/http/server2/request.hpp | 0 .../http/server2/request_handler.cpp | 3 +- .../http/server2/request_handler.hpp | 5 +- .../http/server2/request_parser.cpp | 102 ++-- .../http/server2/request_parser.hpp | 27 +- .../{cpp03 => cpp11}/http/server2/server.cpp | 49 +- .../{cpp03 => cpp11}/http/server2/server.hpp | 22 +- .../echo => cpp11/http/server3}/.gitignore | 0 .../cpp11/http/server3/connection.cpp | 89 +++ .../http/server3/connection.hpp | 35 +- .../{cpp03 => cpp11}/http/server3/header.hpp | 0 .../{cpp03 => cpp11}/http/server3/main.cpp | 4 +- .../http/server3/mime_types.cpp | 0 .../http/server3/mime_types.hpp | 0 .../{cpp03 => cpp11}/http/server3/reply.cpp | 3 +- .../{cpp03 => cpp11}/http/server3/reply.hpp | 0 .../{cpp03 => cpp11}/http/server3/request.hpp | 0 .../http/server3/request_handler.cpp | 3 +- .../http/server3/request_handler.hpp | 5 +- .../http/server3/request_parser.cpp | 102 ++-- .../http/server3/request_parser.hpp | 27 +- .../{cpp03 => cpp11}/http/server3/server.cpp | 64 ++- .../{cpp03 => cpp11}/http/server3/server.hpp | 22 +- .../server => cpp11/http/server4}/.gitignore | 0 .../http/server4/file_handler.cpp | 3 +- .../http/server4/file_handler.hpp | 0 .../{cpp03 => cpp11}/http/server4/header.hpp | 0 .../{cpp03 => cpp11}/http/server4/main.cpp | 8 +- .../http/server4/mime_types.cpp | 0 .../http/server4/mime_types.hpp | 0 .../{cpp03 => cpp11}/http/server4/reply.cpp | 3 +- .../{cpp03 => cpp11}/http/server4/reply.hpp | 0 .../server => cpp11/http/server4}/request.hpp | 10 +- .../http/server4}/request_handler.cpp | 7 +- .../http/server4}/request_handler.hpp | 15 +- .../http/server4}/request_parser.cpp | 106 ++-- .../http/server4}/request_parser.hpp | 37 +- .../{cpp03 => cpp11}/http/server4/server.cpp | 12 +- .../{cpp03 => cpp11}/http/server4/server.hpp | 24 +- .../examples/{cpp03 => cpp11}/icmp/.gitignore | 0 .../{cpp03 => cpp11}/icmp/icmp_header.hpp | 0 .../{cpp03 => cpp11}/icmp/ipv4_header.hpp | 0 .../examples/{cpp03 => cpp11}/icmp/ping.cpp | 7 +- .../cpp11/invocation/prioritised_handlers.cpp | 4 +- .../iostreams/daytime_client.cpp | 0 .../iostreams/daytime_server.cpp | 2 +- .../src/examples/cpp11/local/connect_pair.cpp | 4 +- .../{cpp03 => cpp11}/porthopper/.gitignore | 0 .../{cpp03 => cpp11}/porthopper/client.cpp | 74 ++- .../{cpp03 => cpp11}/porthopper/protocol.hpp | 10 +- .../{cpp03 => cpp11}/porthopper/server.cpp | 32 +- .../{cpp03 => cpp11}/serialization/.gitignore | 0 .../{cpp03 => cpp11}/serialization/client.cpp | 6 +- .../serialization/connection.hpp | 58 +- .../{cpp03 => cpp11}/serialization/server.cpp | 15 +- .../{cpp03 => cpp11}/serialization/stock.hpp | 0 .../{cpp03 => cpp11}/services/.gitignore | 0 .../services/basic_logger.hpp | 5 +- .../services/daytime_client.cpp | 8 +- .../{cpp03 => cpp11}/services/logger.hpp | 0 .../services/logger_service.cpp | 0 .../services/logger_service.hpp | 26 +- asio/src/examples/cpp11/socks4/socks4.hpp | 2 +- asio/src/examples/cpp11/spawn/echo_server.cpp | 4 +- .../tutorial/daytime1/.gitignore | 0 .../tutorial/daytime1/client.cpp | 8 +- .../tutorial/daytime2/.gitignore | 0 .../tutorial/daytime2/server.cpp | 2 +- .../tutorial/daytime3/.gitignore | 0 .../tutorial/daytime3/server.cpp | 17 +- .../tutorial/daytime4/.gitignore | 0 .../tutorial/daytime4/client.cpp | 6 +- .../tutorial/daytime5/.gitignore | 0 .../tutorial/daytime5/server.cpp | 6 +- .../tutorial/daytime6/.gitignore | 0 .../tutorial/daytime6/server.cpp | 20 +- .../tutorial/daytime7/.gitignore | 0 .../tutorial/daytime7/server.cpp | 29 +- .../{cpp03 => cpp11}/tutorial/daytime_dox.txt | 12 +- .../{cpp03 => cpp11}/tutorial/index_dox.txt | 0 .../tutorial/timer1/.gitignore | 0 .../tutorial/timer1/timer.cpp | 0 .../tutorial/timer2/.gitignore | 0 .../tutorial/timer2/timer.cpp | 2 +- .../tutorial/timer3/.gitignore | 0 .../tutorial/timer3/timer.cpp | 8 +- .../tutorial/timer4/.gitignore | 0 .../tutorial/timer4/timer.cpp | 6 +- .../tutorial/timer5/.gitignore | 0 .../tutorial/timer5/timer.cpp | 13 +- .../{cpp03 => cpp11}/tutorial/timer_dox.txt | 23 +- .../cpp11/type_erasure/line_reader.hpp | 6 +- .../cpp11/type_erasure/stdin_line_reader.cpp | 4 +- .../cpp11/type_erasure/stdin_line_reader.hpp | 2 +- .../allocation => cpp11/windows}/.gitignore | 0 .../windows/transmit_file.cpp | 23 +- 214 files changed, 1540 insertions(+), 8535 deletions(-) delete mode 100644 asio/src/examples/cpp03/Makefile.am delete mode 100644 asio/src/examples/cpp03/allocation/server.cpp delete mode 100644 asio/src/examples/cpp03/buffers/.gitignore delete mode 100644 asio/src/examples/cpp03/buffers/reference_counted.cpp delete mode 100644 asio/src/examples/cpp03/chat/chat_client.cpp delete mode 100644 asio/src/examples/cpp03/chat/chat_message.hpp delete mode 100644 asio/src/examples/cpp03/chat/chat_server.cpp delete mode 100644 asio/src/examples/cpp03/chat/posix_chat_client.cpp delete mode 100644 asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp delete mode 100644 asio/src/examples/cpp03/echo/async_udp_echo_server.cpp delete mode 100644 asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp delete mode 100644 asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp delete mode 100644 asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp delete mode 100644 asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp delete mode 100644 asio/src/examples/cpp03/fork/.gitignore delete mode 100644 asio/src/examples/cpp03/fork/daemon.cpp delete mode 100644 asio/src/examples/cpp03/fork/process_per_connection.cpp delete mode 100644 asio/src/examples/cpp03/http/server/connection.cpp delete mode 100644 asio/src/examples/cpp03/http/server/connection.hpp delete mode 100644 asio/src/examples/cpp03/http/server/connection_manager.cpp delete mode 100644 asio/src/examples/cpp03/http/server/connection_manager.hpp delete mode 100644 asio/src/examples/cpp03/http/server/header.hpp delete mode 100644 asio/src/examples/cpp03/http/server/main.cpp delete mode 100644 asio/src/examples/cpp03/http/server/mime_types.cpp delete mode 100644 asio/src/examples/cpp03/http/server/mime_types.hpp delete mode 100644 asio/src/examples/cpp03/http/server/reply.cpp delete mode 100644 asio/src/examples/cpp03/http/server/reply.hpp delete mode 100644 asio/src/examples/cpp03/http/server/server.cpp delete mode 100644 asio/src/examples/cpp03/http/server/server.hpp delete mode 100644 asio/src/examples/cpp03/http/server2/.gitignore delete mode 100644 asio/src/examples/cpp03/http/server2/connection.cpp delete mode 100644 asio/src/examples/cpp03/http/server3/.gitignore delete mode 100644 asio/src/examples/cpp03/http/server3/connection.cpp delete mode 100644 asio/src/examples/cpp03/http/server4/.gitignore delete mode 100644 asio/src/examples/cpp03/http/server4/request.hpp delete mode 100644 asio/src/examples/cpp03/http/server4/request_parser.cpp delete mode 100644 asio/src/examples/cpp03/http/server4/request_parser.hpp delete mode 100644 asio/src/examples/cpp03/invocation/.gitignore delete mode 100644 asio/src/examples/cpp03/invocation/prioritised_handlers.cpp delete mode 100644 asio/src/examples/cpp03/iostreams/.gitignore delete mode 100644 asio/src/examples/cpp03/iostreams/http_client.cpp delete mode 100644 asio/src/examples/cpp03/local/.gitignore delete mode 100644 asio/src/examples/cpp03/local/connect_pair.cpp delete mode 100644 asio/src/examples/cpp03/local/iostream_client.cpp delete mode 100644 asio/src/examples/cpp03/local/stream_client.cpp delete mode 100644 asio/src/examples/cpp03/local/stream_server.cpp delete mode 100644 asio/src/examples/cpp03/multicast/.gitignore delete mode 100644 asio/src/examples/cpp03/multicast/receiver.cpp delete mode 100644 asio/src/examples/cpp03/multicast/sender.cpp delete mode 100644 asio/src/examples/cpp03/nonblocking/.gitignore delete mode 100644 asio/src/examples/cpp03/nonblocking/third_party_lib.cpp delete mode 100644 asio/src/examples/cpp03/socks4/.gitignore delete mode 100644 asio/src/examples/cpp03/socks4/socks4.hpp delete mode 100644 asio/src/examples/cpp03/socks4/sync_client.cpp delete mode 100644 asio/src/examples/cpp03/spawn/.gitignore delete mode 100644 asio/src/examples/cpp03/spawn/echo_server.cpp delete mode 100644 asio/src/examples/cpp03/spawn/parallel_grep.cpp delete mode 100644 asio/src/examples/cpp03/ssl/.gitignore delete mode 100644 asio/src/examples/cpp03/ssl/README delete mode 100644 asio/src/examples/cpp03/ssl/ca.pem delete mode 100644 asio/src/examples/cpp03/ssl/client.cpp delete mode 100644 asio/src/examples/cpp03/ssl/dh4096.pem delete mode 100644 asio/src/examples/cpp03/ssl/server.cpp delete mode 100644 asio/src/examples/cpp03/ssl/server.pem delete mode 100644 asio/src/examples/cpp03/timeouts/.gitignore delete mode 100644 asio/src/examples/cpp03/timeouts/async_tcp_client.cpp delete mode 100644 asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp delete mode 100644 asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp delete mode 100644 asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp delete mode 100644 asio/src/examples/cpp03/timeouts/server.cpp delete mode 100644 asio/src/examples/cpp03/timers/.gitignore delete mode 100644 asio/src/examples/cpp03/timers/time_t_timer.cpp delete mode 100644 asio/src/examples/cpp03/windows/.gitignore create mode 100644 asio/src/examples/cpp11/chat/posix_chat_client.cpp rename asio/src/examples/{cpp03 => cpp11}/http/client/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/http/client/async_client.cpp (86%) rename asio/src/examples/{cpp03 => cpp11}/http/client/sync_client.cpp (97%) rename asio/src/examples/{cpp03 => cpp11}/http/doc_root/data_1K.html (100%) rename asio/src/examples/{cpp03 => cpp11}/http/doc_root/data_2K.html (100%) rename asio/src/examples/{cpp03 => cpp11}/http/doc_root/data_4K.html (100%) rename asio/src/examples/{cpp03 => cpp11}/http/doc_root/data_8K.html (100%) rename asio/src/examples/{cpp03/chat => cpp11/http/server2}/.gitignore (100%) create mode 100644 asio/src/examples/cpp11/http/server2/connection.cpp rename asio/src/examples/{cpp03 => cpp11}/http/server2/connection.hpp (61%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/header.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/io_context_pool.cpp (83%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/io_context_pool.hpp (86%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/main.cpp (87%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/mime_types.cpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/mime_types.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/reply.cpp (98%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/reply.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/request.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/request_handler.cpp (96%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/request_handler.hpp (90%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/request_parser.cpp (75%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/request_parser.hpp (71%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/server.cpp (65%) rename asio/src/examples/{cpp03 => cpp11}/http/server2/server.hpp (74%) rename asio/src/examples/{cpp03/echo => cpp11/http/server3}/.gitignore (100%) create mode 100644 asio/src/examples/cpp11/http/server3/connection.cpp rename asio/src/examples/{cpp03 => cpp11}/http/server3/connection.hpp (57%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/header.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/main.cpp (87%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/mime_types.cpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/mime_types.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/reply.cpp (98%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/reply.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/request.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/request_handler.cpp (96%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/request_handler.hpp (90%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/request_parser.cpp (75%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/request_parser.hpp (71%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/server.cpp (58%) rename asio/src/examples/{cpp03 => cpp11}/http/server3/server.hpp (75%) rename asio/src/examples/{cpp03/http/server => cpp11/http/server4}/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/file_handler.cpp (96%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/file_handler.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/header.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/main.cpp (91%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/mime_types.cpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/mime_types.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/reply.cpp (98%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/reply.hpp (100%) rename asio/src/examples/{cpp03/http/server => cpp11/http/server4}/request.hpp (79%) rename asio/src/examples/{cpp03/http/server => cpp11/http/server4}/request_handler.cpp (94%) rename asio/src/examples/{cpp03/http/server => cpp11/http/server4}/request_handler.hpp (76%) rename asio/src/examples/{cpp03/http/server => cpp11/http/server4}/request_parser.cpp (75%) rename asio/src/examples/{cpp03/http/server => cpp11/http/server4}/request_parser.hpp (65%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/server.cpp (92%) rename asio/src/examples/{cpp03 => cpp11}/http/server4/server.hpp (72%) rename asio/src/examples/{cpp03 => cpp11}/icmp/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/icmp/icmp_header.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/icmp/ipv4_header.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/icmp/ping.cpp (94%) rename asio/src/examples/{cpp03 => cpp11}/iostreams/daytime_client.cpp (100%) rename asio/src/examples/{cpp03 => cpp11}/iostreams/daytime_server.cpp (97%) rename asio/src/examples/{cpp03 => cpp11}/porthopper/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/porthopper/client.cpp (75%) rename asio/src/examples/{cpp03 => cpp11}/porthopper/protocol.hpp (94%) rename asio/src/examples/{cpp03 => cpp11}/porthopper/server.cpp (85%) rename asio/src/examples/{cpp03 => cpp11}/serialization/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/serialization/client.cpp (96%) rename asio/src/examples/{cpp03 => cpp11}/serialization/connection.hpp (75%) rename asio/src/examples/{cpp03 => cpp11}/serialization/server.cpp (88%) rename asio/src/examples/{cpp03 => cpp11}/serialization/stock.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/services/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/services/basic_logger.hpp (94%) rename asio/src/examples/{cpp03 => cpp11}/services/daytime_client.cpp (92%) rename asio/src/examples/{cpp03 => cpp11}/services/logger.hpp (100%) rename asio/src/examples/{cpp03 => cpp11}/services/logger_service.cpp (100%) rename asio/src/examples/{cpp03 => cpp11}/services/logger_service.hpp (86%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime1/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime1/client.cpp (87%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime2/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime2/server.cpp (96%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime3/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime3/server.cpp (81%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime4/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime4/client.cpp (90%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime5/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime5/server.cpp (90%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime6/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime6/server.cpp (77%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime7/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime7/server.cpp (76%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/daytime_dox.txt (96%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/index_dox.txt (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer1/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer1/timer.cpp (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer2/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer2/timer.cpp (92%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer3/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer3/timer.cpp (84%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer4/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer4/timer.cpp (84%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer5/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer5/timer.cpp (83%) rename asio/src/examples/{cpp03 => cpp11}/tutorial/timer_dox.txt (95%) rename asio/src/examples/{cpp03/allocation => cpp11/windows}/.gitignore (100%) rename asio/src/examples/{cpp03 => cpp11}/windows/transmit_file.cpp (88%) diff --git a/asio/boostify.pl b/asio/boostify.pl index 74c6c17fab..a52b886633 100755 --- a/asio/boostify.pl +++ b/asio/boostify.pl @@ -295,6 +295,12 @@ sub copy_source_file $line =~ s/asio::/boost::asio::/g if !$is_xsl; print_line($output, $line, $from, $lineno); } + elsif ($line =~ /std::system_error/) + { + $line =~ s/std::system_error/boost::system::system_error/g; + $line =~ s/asio::/boost::asio::/g if !$is_xsl; + print_line($output, $line, $from, $lineno); + } elsif ($line =~ /ec\.assign\(0, ec\.category\(\)\)/) { $line =~ s/ec\.assign\(0, ec\.category\(\)\)/ec = boost::system::error_code()/g; @@ -555,56 +561,23 @@ sub copy_properties_tests sub copy_examples { my @dirs = ( - "src/examples/cpp03/allocation", - "src/examples/cpp03/buffers", - "src/examples/cpp03/chat", - "src/examples/cpp03/echo", - "src/examples/cpp03/fork", - "src/examples/cpp03/http/client", - "src/examples/cpp03/http/doc_root", - "src/examples/cpp03/http/server", - "src/examples/cpp03/http/server2", - "src/examples/cpp03/http/server3", - "src/examples/cpp03/http/server4", - "src/examples/cpp03/icmp", - "src/examples/cpp03/invocation", - "src/examples/cpp03/iostreams", - "src/examples/cpp03/local", - "src/examples/cpp03/multicast", - "src/examples/cpp03/nonblocking", - "src/examples/cpp03/porthopper", - "src/examples/cpp03/serialization", - "src/examples/cpp03/services", - "src/examples/cpp03/socks4", - "src/examples/cpp03/spawn", - "src/examples/cpp03/ssl", - "src/examples/cpp03/timeouts", - "src/examples/cpp03/timers", - "src/examples/cpp03/tutorial", - "src/examples/cpp03/tutorial/daytime1", - "src/examples/cpp03/tutorial/daytime2", - "src/examples/cpp03/tutorial/daytime3", - "src/examples/cpp03/tutorial/daytime4", - "src/examples/cpp03/tutorial/daytime5", - "src/examples/cpp03/tutorial/daytime6", - "src/examples/cpp03/tutorial/daytime7", - "src/examples/cpp03/tutorial/timer1", - "src/examples/cpp03/tutorial/timer2", - "src/examples/cpp03/tutorial/timer3", - "src/examples/cpp03/tutorial/timer4", - "src/examples/cpp03/tutorial/timer5", - "src/examples/cpp03/windows", "src/examples/cpp11/allocation", "src/examples/cpp11/buffers", "src/examples/cpp11/chat", "src/examples/cpp11/deferred", "src/examples/cpp11/echo", "src/examples/cpp11/executors", - "src/examples/cpp11/fork", "src/examples/cpp11/files", + "src/examples/cpp11/fork", "src/examples/cpp11/futures", "src/examples/cpp11/handler_tracking", + "src/examples/cpp11/http/client", + "src/examples/cpp11/http/doc_root", "src/examples/cpp11/http/server", + "src/examples/cpp11/http/server2", + "src/examples/cpp11/http/server3", + "src/examples/cpp11/http/server4", + "src/examples/cpp11/icmp", "src/examples/cpp11/invocation", "src/examples/cpp11/iostreams", "src/examples/cpp11/local", @@ -612,12 +585,29 @@ sub copy_examples "src/examples/cpp11/nonblocking", "src/examples/cpp11/operations", "src/examples/cpp11/parallel_group", + "src/examples/cpp11/porthopper", + "src/examples/cpp11/serialization", + "src/examples/cpp11/services", "src/examples/cpp11/socks4", "src/examples/cpp11/spawn", "src/examples/cpp11/ssl", "src/examples/cpp11/timeouts", "src/examples/cpp11/timers", + "src/examples/cpp11/tutorial", + "src/examples/cpp11/tutorial/daytime1", + "src/examples/cpp11/tutorial/daytime2", + "src/examples/cpp11/tutorial/daytime3", + "src/examples/cpp11/tutorial/daytime4", + "src/examples/cpp11/tutorial/daytime5", + "src/examples/cpp11/tutorial/daytime6", + "src/examples/cpp11/tutorial/daytime7", + "src/examples/cpp11/tutorial/timer1", + "src/examples/cpp11/tutorial/timer2", + "src/examples/cpp11/tutorial/timer3", + "src/examples/cpp11/tutorial/timer4", + "src/examples/cpp11/tutorial/timer5", "src/examples/cpp11/type_erasure", + "src/examples/cpp11/windows", "src/examples/cpp14/deferred", "src/examples/cpp14/echo", "src/examples/cpp14/executors", diff --git a/asio/configure.ac b/asio/configure.ac index 3908366c2f..0fbbdbd146 100644 --- a/asio/configure.ac +++ b/asio/configure.ac @@ -252,7 +252,6 @@ AC_OUTPUT([ 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/asio/release.pl b/asio/release.pl index 9e7068da39..fb9572e294 100755 --- a/asio/release.pl +++ b/asio/release.pl @@ -201,27 +201,6 @@ sub build_asio_doc system("cp -vR src/doc/html/* doc"); } -sub build_example_diffs -{ - my @cpp11_files = `find src/examples/cpp11 -type f -name "*.*pp"`; - foreach my $cpp11_file (@cpp11_files) - { - chomp($cpp11_file); - - my $cpp03_file = $cpp11_file; - $cpp03_file =~ s/\/cpp11\//\/cpp03\//; - my $output_diff = $cpp11_file; - $output_diff =~ s/src\/examples\/cpp11\///g; - my ($output_diff_name, $output_dir) = fileparse($output_diff); - my $output_html = $output_diff . ".html"; - - mkpath("doc/examples/diffs/$output_dir"); - system("diff -U1000000 $cpp03_file $cpp11_file > doc/examples/diffs/$output_diff"); - system("cd doc/examples/diffs && diff2html.py -i $output_diff -o $output_html"); - unlink("doc/examples/diffs/$output_diff"); - } -} - sub make_asio_packages { our $asio_name; @@ -428,7 +407,6 @@ sub make_boost_asio_packages if ($package_asio) { build_asio_doc(); - build_example_diffs(); make_asio_packages(); } diff --git a/asio/src/Makefile.am b/asio/src/Makefile.am index 0345f094f8..587bb4935e 100644 --- a/asio/src/Makefile.am +++ b/asio/src/Makefile.am @@ -1,7 +1,3 @@ -if !STANDALONE -EXAMPLES_CPP03 = examples/cpp03 -endif - if HAVE_CXX11 EXAMPLES_CPP11 = examples/cpp11 endif @@ -19,7 +15,6 @@ EXAMPLES_CPP20 = examples/cpp20 endif SUBDIRS = \ - $(EXAMPLES_CPP03) \ $(EXAMPLES_CPP11) \ $(EXAMPLES_CPP14) \ $(EXAMPLES_CPP17) \ @@ -27,7 +22,6 @@ SUBDIRS = \ tests DIST_SUBDIRS = \ - examples/cpp03 \ examples/cpp11 \ examples/cpp14 \ examples/cpp17 \ diff --git a/asio/src/Makefile.mgw b/asio/src/Makefile.mgw index a88a7c1c78..1fea10c2cd 100644 --- a/asio/src/Makefile.mgw +++ b/asio/src/Makefile.mgw @@ -162,66 +162,67 @@ UNIT_TEST_EXES = \ tests/unit/write.exe \ tests/unit/write_at.exe -CPP03_EXAMPLE_EXES = \ - examples/cpp03/allocation/server.exe \ - examples/cpp03/buffers/reference_counted.exe \ - examples/cpp03/chat/chat_client.exe \ - examples/cpp03/chat/chat_server.exe \ - examples/cpp03/echo/async_tcp_echo_server.exe \ - examples/cpp03/echo/async_udp_echo_server.exe \ - examples/cpp03/echo/blocking_tcp_echo_client.exe \ - examples/cpp03/echo/blocking_tcp_echo_server.exe \ - examples/cpp03/echo/blocking_udp_echo_client.exe \ - examples/cpp03/echo/blocking_udp_echo_server.exe \ - examples/cpp03/http/client/async_client.exe \ - examples/cpp03/http/client/sync_client.exe \ - examples/cpp03/http/server/http_server.exe \ - examples/cpp03/http/server2/http_server.exe \ - examples/cpp03/http/server3/http_server.exe \ - examples/cpp03/http/server4/http_server.exe \ - examples/cpp03/icmp/ping.exe \ - examples/cpp03/invocation/prioritised_handlers.exe \ - examples/cpp03/iostreams/daytime_client.exe \ - examples/cpp03/iostreams/daytime_server.exe \ - examples/cpp03/iostreams/http_client.exe \ - examples/cpp03/multicast/receiver.exe \ - examples/cpp03/multicast/sender.exe \ - examples/cpp03/nonblocking/third_party_lib.exe \ - examples/cpp03/porthopper/client.exe \ - examples/cpp03/porthopper/server.exe \ - examples/cpp03/services/daytime_client.exe \ - examples/cpp03/socks4/sync_client.exe \ - examples/cpp03/timeouts/async_tcp_client.exe \ - examples/cpp03/timeouts/blocking_tcp_client.exe \ - examples/cpp03/timeouts/blocking_token_tcp_client.exe \ - examples/cpp03/timeouts/blocking_udp_client.exe \ - examples/cpp03/timeouts/server.exe \ - examples/cpp03/timers/time_t_timer.exe \ - examples/cpp03/tutorial/timer1/timer.exe \ - examples/cpp03/tutorial/timer2/timer.exe \ - examples/cpp03/tutorial/timer3/timer.exe \ - examples/cpp03/tutorial/timer4/timer.exe \ - examples/cpp03/tutorial/timer5/timer.exe \ - examples/cpp03/tutorial/daytime1/client.exe \ - examples/cpp03/tutorial/daytime2/server.exe \ - examples/cpp03/tutorial/daytime3/server.exe \ - examples/cpp03/tutorial/daytime4/client.exe \ - examples/cpp03/tutorial/daytime5/server.exe \ - examples/cpp03/tutorial/daytime6/server.exe \ - examples/cpp03/tutorial/daytime7/server.exe \ - examples/cpp03/windows/transmit_file.exe +CPP11_EXAMPLE_EXES = \ + examples/cpp11/allocation/server.exe \ + examples/cpp11/buffers/reference_counted.exe \ + examples/cpp11/chat/chat_client.exe \ + examples/cpp11/chat/chat_server.exe \ + examples/cpp11/echo/async_tcp_echo_server.exe \ + examples/cpp11/echo/async_udp_echo_server.exe \ + examples/cpp11/echo/blocking_tcp_echo_client.exe \ + examples/cpp11/echo/blocking_tcp_echo_server.exe \ + examples/cpp11/echo/blocking_udp_echo_client.exe \ + examples/cpp11/echo/blocking_udp_echo_server.exe \ + examples/cpp11/http/client/async_client.exe \ + examples/cpp11/http/client/sync_client.exe \ + examples/cpp11/http/server/http_server.exe \ + examples/cpp11/http/server2/http_server.exe \ + examples/cpp11/http/server3/http_server.exe \ + examples/cpp11/http/server4/http_server.exe \ + examples/cpp11/icmp/ping.exe \ + examples/cpp11/invocation/prioritised_handlers.exe \ + examples/cpp11/iostreams/daytime_client.exe \ + examples/cpp11/iostreams/daytime_server.exe \ + examples/cpp11/iostreams/http_client.exe \ + examples/cpp11/multicast/receiver.exe \ + examples/cpp11/multicast/sender.exe \ + examples/cpp11/nonblocking/third_party_lib.exe \ + examples/cpp11/porthopper/client.exe \ + examples/cpp11/porthopper/server.exe \ + examples/cpp11/services/daytime_client.exe \ + examples/cpp11/socks4/sync_client.exe \ + examples/cpp11/timeouts/async_tcp_client.exe \ + examples/cpp11/timeouts/blocking_tcp_client.exe \ + examples/cpp11/timeouts/blocking_token_tcp_client.exe \ + examples/cpp11/timeouts/blocking_udp_client.exe \ + examples/cpp11/timeouts/server.exe \ + examples/cpp11/timers/time_t_timer.exe \ + examples/cpp11/tutorial/timer1/timer.exe \ + examples/cpp11/tutorial/timer2/timer.exe \ + examples/cpp11/tutorial/timer3/timer.exe \ + examples/cpp11/tutorial/timer4/timer.exe \ + examples/cpp11/tutorial/timer5/timer.exe \ + examples/cpp11/tutorial/daytime1/client.exe \ + examples/cpp11/tutorial/daytime2/server.exe \ + examples/cpp11/tutorial/daytime3/server.exe \ + examples/cpp11/tutorial/daytime4/client.exe \ + examples/cpp11/tutorial/daytime5/server.exe \ + examples/cpp11/tutorial/daytime6/server.exe \ + examples/cpp11/tutorial/daytime7/server.exe \ + examples/cpp11/windows/transmit_file.exe ifdef STANDALONE all: \ $(SEPARATE_COMPILATION_LIB) \ + $(EXAMPLE_EXES) \ $(UNIT_TEST_EXES) else all: \ $(SEPARATE_COMPILATION_LIB) \ $(PERFORMANCE_TEST_EXES) \ - $(UNIT_TEST_EXES) \ $(EXAMPLE_EXES) \ - $(OTHER_EXAMPLE_EXES) + $(OTHER_EXAMPLE_EXES) \ + $(UNIT_TEST_EXES) endif ifdef SEPARATE_COMPILATION @@ -249,41 +250,41 @@ $(UNIT_TEST_EXES): %.exe: %.o $(PERFORMANCE_TEST_EXES) $(EXAMPLE_EXES): %.exe: %.o g++ -o$@ $(LDFLAGS) $< $(LIBS) -examples/cpp03/http/server/http_server.exe: \ - examples/cpp03/http/server/connection.o \ - examples/cpp03/http/server/connection_manager.o \ - examples/cpp03/http/server/main.o \ - examples/cpp03/http/server/mime_types.o \ - examples/cpp03/http/server/reply.o \ - examples/cpp03/http/server/request_handler.o \ - examples/cpp03/http/server/request_parser.o \ - examples/cpp03/http/server/server.o +examples/cpp11/http/server/http_server.exe: \ + examples/cpp11/http/server/connection.o \ + examples/cpp11/http/server/connection_manager.o \ + examples/cpp11/http/server/main.o \ + examples/cpp11/http/server/mime_types.o \ + examples/cpp11/http/server/reply.o \ + examples/cpp11/http/server/request_handler.o \ + examples/cpp11/http/server/request_parser.o \ + examples/cpp11/http/server/server.o g++ -o$@ $(LDFLAGS) $^ $(LIBS) -examples/cpp03/http/server2/http_server.exe: \ - examples/cpp03/http/server2/connection.o \ - examples/cpp03/http/server2/io_context_pool.o \ - examples/cpp03/http/server2/main.o \ - examples/cpp03/http/server2/mime_types.o \ - examples/cpp03/http/server2/reply.o \ - examples/cpp03/http/server2/request_handler.o \ - examples/cpp03/http/server2/request_parser.o \ - examples/cpp03/http/server2/server.o +examples/cpp11/http/server2/http_server.exe: \ + examples/cpp11/http/server2/connection.o \ + examples/cpp11/http/server2/io_context_pool.o \ + examples/cpp11/http/server2/main.o \ + examples/cpp11/http/server2/mime_types.o \ + examples/cpp11/http/server2/reply.o \ + examples/cpp11/http/server2/request_handler.o \ + examples/cpp11/http/server2/request_parser.o \ + examples/cpp11/http/server2/server.o g++ -o$@ $(LDFLAGS) $^ $(LIBS) -examples/cpp03/http/server3/http_server.exe: \ - examples/cpp03/http/server3/connection.o \ - examples/cpp03/http/server3/main.o \ - examples/cpp03/http/server3/mime_types.o \ - examples/cpp03/http/server3/reply.o \ - examples/cpp03/http/server3/request_handler.o \ - examples/cpp03/http/server3/request_parser.o \ - examples/cpp03/http/server3/server.o +examples/cpp11/http/server3/http_server.exe: \ + examples/cpp11/http/server3/connection.o \ + examples/cpp11/http/server3/main.o \ + examples/cpp11/http/server3/mime_types.o \ + examples/cpp11/http/server3/reply.o \ + examples/cpp11/http/server3/request_handler.o \ + examples/cpp11/http/server3/request_parser.o \ + examples/cpp11/http/server3/server.o g++ -o$@ $(LDFLAGS) $^ $(LIBS) -examples/cpp03/services/daytime_client.exe: \ - examples/cpp03/services/daytime_client.o \ - examples/cpp03/services/logger_service.o +examples/cpp11/services/daytime_client.exe: \ + examples/cpp11/services/daytime_client.o \ + examples/cpp11/services/logger_service.o g++ -o$@ $(LDFLAGS) $^ $(LIBS) .cpp.o: diff --git a/asio/src/Makefile.msc b/asio/src/Makefile.msc index baec16dcb2..840dc7bebf 100644 --- a/asio/src/Makefile.msc +++ b/asio/src/Makefile.msc @@ -271,54 +271,54 @@ UNIT_TEST_EXES = \ tests\unit\write.exe \ tests\unit\write_at.exe -CPP03_EXAMPLE_EXES = \ - examples\cpp03\allocation\server.exe \ - examples\cpp03\buffers\reference_counted.exe \ - examples\cpp03\chat\chat_client.exe \ - examples\cpp03\chat\chat_server.exe \ - examples\cpp03\echo\async_tcp_echo_server.exe \ - examples\cpp03\echo\async_udp_echo_server.exe \ - examples\cpp03\echo\blocking_tcp_echo_client.exe \ - examples\cpp03\echo\blocking_tcp_echo_server.exe \ - examples\cpp03\echo\blocking_udp_echo_client.exe \ - examples\cpp03\echo\blocking_udp_echo_server.exe \ - examples\cpp03\http\client\async_client.exe \ - examples\cpp03\http\client\sync_client.exe \ - examples\cpp03\http\server\http_server.exe \ - examples\cpp03\http\server2\http_server.exe \ - examples\cpp03\http\server3\http_server.exe \ - examples\cpp03\http\server4\http_server.exe \ - examples\cpp03\icmp\ping.exe \ - examples\cpp03\invocation\prioritised_handlers.exe \ - examples\cpp03\iostreams\daytime_client.exe \ - examples\cpp03\iostreams\daytime_server.exe \ - examples\cpp03\iostreams\http_client.exe \ - examples\cpp03\multicast\receiver.exe \ - examples\cpp03\multicast\sender.exe \ - examples\cpp03\nonblocking\third_party_lib.exe \ - examples\cpp03\porthopper\client.exe \ - examples\cpp03\porthopper\server.exe \ - examples\cpp03\services\daytime_client.exe \ - examples\cpp03\socks4\sync_client.exe \ - examples\cpp03\timeouts\async_tcp_client.exe \ - examples\cpp03\timeouts\blocking_tcp_client.exe \ - examples\cpp03\timeouts\blocking_token_tcp_client.exe \ - examples\cpp03\timeouts\blocking_udp_client.exe \ - examples\cpp03\timeouts\server.exe \ - examples\cpp03\timers\time_t_timer.exe \ - examples\cpp03\tutorial\timer1\timer.exe \ - examples\cpp03\tutorial\timer2\timer.exe \ - examples\cpp03\tutorial\timer3\timer.exe \ - examples\cpp03\tutorial\timer4\timer.exe \ - examples\cpp03\tutorial\timer5\timer.exe \ - examples\cpp03\tutorial\daytime1\client.exe \ - examples\cpp03\tutorial\daytime2\server.exe \ - examples\cpp03\tutorial\daytime3\server.exe \ - examples\cpp03\tutorial\daytime4\client.exe \ - examples\cpp03\tutorial\daytime5\server.exe \ - examples\cpp03\tutorial\daytime6\server.exe \ - examples\cpp03\tutorial\daytime7\server.exe \ - examples\cpp03\windows\transmit_file.exe +CPP11_EXAMPLE_EXES = \ + examples\cpp11\allocation\server.exe \ + examples\cpp11\buffers\reference_counted.exe \ + examples\cpp11\chat\chat_client.exe \ + examples\cpp11\chat\chat_server.exe \ + examples\cpp11\echo\async_tcp_echo_server.exe \ + examples\cpp11\echo\async_udp_echo_server.exe \ + examples\cpp11\echo\blocking_tcp_echo_client.exe \ + examples\cpp11\echo\blocking_tcp_echo_server.exe \ + examples\cpp11\echo\blocking_udp_echo_client.exe \ + examples\cpp11\echo\blocking_udp_echo_server.exe \ + examples\cpp11\http\client\async_client.exe \ + examples\cpp11\http\client\sync_client.exe \ + examples\cpp11\http\server\http_server.exe \ + examples\cpp11\http\server2\http_server.exe \ + examples\cpp11\http\server3\http_server.exe \ + examples\cpp11\http\server4\http_server.exe \ + examples\cpp11\icmp\ping.exe \ + examples\cpp11\invocation\prioritised_handlers.exe \ + examples\cpp11\iostreams\daytime_client.exe \ + examples\cpp11\iostreams\daytime_server.exe \ + examples\cpp11\iostreams\http_client.exe \ + examples\cpp11\multicast\receiver.exe \ + examples\cpp11\multicast\sender.exe \ + examples\cpp11\nonblocking\third_party_lib.exe \ + examples\cpp11\porthopper\client.exe \ + examples\cpp11\porthopper\server.exe \ + examples\cpp11\services\daytime_client.exe \ + examples\cpp11\socks4\sync_client.exe \ + examples\cpp11\timeouts\async_tcp_client.exe \ + examples\cpp11\timeouts\blocking_tcp_client.exe \ + examples\cpp11\timeouts\blocking_token_tcp_client.exe \ + examples\cpp11\timeouts\blocking_udp_client.exe \ + examples\cpp11\timeouts\server.exe \ + examples\cpp11\timers\time_t_timer.exe \ + examples\cpp11\tutorial\timer1\timer.exe \ + examples\cpp11\tutorial\timer2\timer.exe \ + examples\cpp11\tutorial\timer3\timer.exe \ + examples\cpp11\tutorial\timer4\timer.exe \ + examples\cpp11\tutorial\timer5\timer.exe \ + examples\cpp11\tutorial\daytime1\client.exe \ + examples\cpp11\tutorial\daytime2\server.exe \ + examples\cpp11\tutorial\daytime3\server.exe \ + examples\cpp11\tutorial\daytime4\client.exe \ + examples\cpp11\tutorial\daytime5\server.exe \ + examples\cpp11\tutorial\daytime6\server.exe \ + examples\cpp11\tutorial\daytime7\server.exe \ + examples\cpp11\windows\transmit_file.exe SSL_UNIT_TEST_EXES = \ tests\unit\ssl\basic_context.exe \ @@ -331,8 +331,8 @@ SSL_UNIT_TEST_EXES = \ tests\unit\ssl\stream_service.exe SSL_EXAMPLE_EXES = \ - examples\cpp03\ssl\client.exe \ - examples\cpp03\ssl\server.exe + examples\cpp11\ssl\client.exe \ + examples\cpp11\ssl\server.exe !ifdef SEPARATE_COMPILATION all: asio.lib @@ -343,13 +343,14 @@ asio.lib: asio.cpp !ifdef STANDALONE all: \ + $(CPP11_EXAMPLE_EXES) \ $(UNIT_TEST_EXES) !else all: \ $(LATENCY_TEST_EXES) \ $(PERFORMANCE_TEST_EXES) \ - $(UNIT_TEST_EXES) \ - $(CPP03_EXAMPLE_EXES) + $(CPP11_EXAMPLE_EXES) \ + $(UNIT_TEST_EXES) !endif ssl: \ @@ -392,88 +393,88 @@ tests\unit\unit_test.obj: tests\unit\unit_test.cpp {tests\unit\windows}.cpp{tests\unit\windows}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\allocation}.cpp{examples\cpp03\allocation}.exe: +{examples\cpp11\allocation}.cpp{examples\cpp11\allocation}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\buffers}.cpp{examples\cpp03\buffers}.exe: +{examples\cpp11\buffers}.cpp{examples\cpp11\buffers}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\chat}.cpp{examples\cpp03\chat}.exe: +{examples\cpp11\chat}.cpp{examples\cpp11\chat}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\echo}.cpp{examples\cpp03\echo}.exe: +{examples\cpp11\echo}.cpp{examples\cpp11\echo}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\http\client}.cpp{examples\cpp03\http\client}.exe: +{examples\cpp11\http\client}.cpp{examples\cpp11\http\client}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\icmp}.cpp{examples\cpp03\icmp}.exe: +{examples\cpp11\icmp}.cpp{examples\cpp11\icmp}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\invocation}.cpp{examples\cpp03\invocation}.exe: +{examples\cpp11\invocation}.cpp{examples\cpp11\invocation}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\iostreams}.cpp{examples\cpp03\iostreams}.exe: +{examples\cpp11\iostreams}.cpp{examples\cpp11\iostreams}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\multicast}.cpp{examples\cpp03\multicast}.exe: +{examples\cpp11\multicast}.cpp{examples\cpp11\multicast}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\nonblocking}.cpp{examples\cpp03\nonblocking}.exe: +{examples\cpp11\nonblocking}.cpp{examples\cpp11\nonblocking}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\porthopper}.cpp{examples\cpp03\porthopper}.exe: +{examples\cpp11\porthopper}.cpp{examples\cpp11\porthopper}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\socks4}.cpp{examples\cpp03\socks4}.exe: +{examples\cpp11\socks4}.cpp{examples\cpp11\socks4}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\ssl}.cpp{examples\cpp03\ssl}.exe: +{examples\cpp11\ssl}.cpp{examples\cpp11\ssl}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(SSL_CXXFLAGS) $(DEFINES) $< $(SSL_LIBS) $(LIBS) -link -opt:ref -{examples\cpp03\timeouts}.cpp{examples\cpp03\timeouts}.exe: +{examples\cpp11\timeouts}.cpp{examples\cpp11\timeouts}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\timers}.cpp{examples\cpp03\timers}.exe: +{examples\cpp11\timers}.cpp{examples\cpp11\timers}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\timer1}.cpp{examples\cpp03\tutorial\timer1}.exe: +{examples\cpp11\tutorial\timer1}.cpp{examples\cpp11\tutorial\timer1}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\timer2}.cpp{examples\cpp03\tutorial\timer2}.exe: +{examples\cpp11\tutorial\timer2}.cpp{examples\cpp11\tutorial\timer2}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\timer3}.cpp{examples\cpp03\tutorial\timer3}.exe: +{examples\cpp11\tutorial\timer3}.cpp{examples\cpp11\tutorial\timer3}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\timer4}.cpp{examples\cpp03\tutorial\timer4}.exe: +{examples\cpp11\tutorial\timer4}.cpp{examples\cpp11\tutorial\timer4}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\timer5}.cpp{examples\cpp03\tutorial\timer5}.exe: +{examples\cpp11\tutorial\timer5}.cpp{examples\cpp11\tutorial\timer5}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime1}.cpp{examples\cpp03\tutorial\daytime1}.exe: +{examples\cpp11\tutorial\daytime1}.cpp{examples\cpp11\tutorial\daytime1}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime2}.cpp{examples\cpp03\tutorial\daytime2}.exe: +{examples\cpp11\tutorial\daytime2}.cpp{examples\cpp11\tutorial\daytime2}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime3}.cpp{examples\cpp03\tutorial\daytime3}.exe: +{examples\cpp11\tutorial\daytime3}.cpp{examples\cpp11\tutorial\daytime3}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime4}.cpp{examples\cpp03\tutorial\daytime4}.exe: +{examples\cpp11\tutorial\daytime4}.cpp{examples\cpp11\tutorial\daytime4}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime5}.cpp{examples\cpp03\tutorial\daytime5}.exe: +{examples\cpp11\tutorial\daytime5}.cpp{examples\cpp11\tutorial\daytime5}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime6}.cpp{examples\cpp03\tutorial\daytime6}.exe: +{examples\cpp11\tutorial\daytime6}.cpp{examples\cpp11\tutorial\daytime6}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\tutorial\daytime7}.cpp{examples\cpp03\tutorial\daytime7}.exe: +{examples\cpp11\tutorial\daytime7}.cpp{examples\cpp11\tutorial\daytime7}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -{examples\cpp03\windows}.cpp{examples\cpp03\windows}.exe: +{examples\cpp11\windows}.cpp{examples\cpp11\windows}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref {examples\cpp11\executors}.cpp{examples\cpp11\executors}.exe: @@ -485,51 +486,51 @@ tests\unit\unit_test.obj: tests\unit\unit_test.cpp {examples\cpp14\operations}.cpp{examples\cpp14\operations}.exe: cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref -examples\cpp03\http\server\http_server.exe: \ - examples\cpp03\http\server\connection.cpp \ - examples\cpp03\http\server\connection_manager.cpp \ - examples\cpp03\http\server\main.cpp \ - examples\cpp03\http\server\mime_types.cpp \ - examples\cpp03\http\server\reply.cpp \ - examples\cpp03\http\server\request_handler.cpp \ - examples\cpp03\http\server\request_parser.cpp \ - examples\cpp03\http\server\server.cpp - cl -Fe$@ -Foexamples\cpp03\http\server\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref - -examples\cpp03\http\server2\http_server.exe: \ - examples\cpp03\http\server2\connection.cpp \ - examples\cpp03\http\server2\io_context_pool.cpp \ - examples\cpp03\http\server2\main.cpp \ - examples\cpp03\http\server2\mime_types.cpp \ - examples\cpp03\http\server2\reply.cpp \ - examples\cpp03\http\server2\request_handler.cpp \ - examples\cpp03\http\server2\request_parser.cpp \ - examples\cpp03\http\server2\server.cpp - cl -Fe$@ -Foexamples\cpp03\http\server2\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref - -examples\cpp03\http\server3\http_server.exe: \ - examples\cpp03\http\server3\connection.cpp \ - examples\cpp03\http\server3\main.cpp \ - examples\cpp03\http\server3\mime_types.cpp \ - examples\cpp03\http\server3\reply.cpp \ - examples\cpp03\http\server3\request_handler.cpp \ - examples\cpp03\http\server3\request_parser.cpp \ - examples\cpp03\http\server3\server.cpp - cl -Fe$@ -Foexamples\cpp03\http\server3\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref - -examples\cpp03\http\server4\http_server.exe: \ - examples\cpp03\http\server4\file_handler.cpp \ - examples\cpp03\http\server4\main.cpp \ - examples\cpp03\http\server4\mime_types.cpp \ - examples\cpp03\http\server4\reply.cpp \ - examples\cpp03\http\server4\request_parser.cpp \ - examples\cpp03\http\server4\server.cpp - cl -Fe$@ -Foexamples\cpp03\http\server4\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref - -examples\cpp03\services\daytime_client.exe: \ - examples\cpp03\services\daytime_client.cpp \ - examples\cpp03\services\logger_service.cpp - cl -Fe$@ -Foexamples\cpp03\services\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref +examples\cpp11\http\server\http_server.exe: \ + examples\cpp11\http\server\connection.cpp \ + examples\cpp11\http\server\connection_manager.cpp \ + examples\cpp11\http\server\main.cpp \ + examples\cpp11\http\server\mime_types.cpp \ + examples\cpp11\http\server\reply.cpp \ + examples\cpp11\http\server\request_handler.cpp \ + examples\cpp11\http\server\request_parser.cpp \ + examples\cpp11\http\server\server.cpp + cl -Fe$@ -Foexamples\cpp11\http\server\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref + +examples\cpp11\http\server2\http_server.exe: \ + examples\cpp11\http\server2\connection.cpp \ + examples\cpp11\http\server2\io_context_pool.cpp \ + examples\cpp11\http\server2\main.cpp \ + examples\cpp11\http\server2\mime_types.cpp \ + examples\cpp11\http\server2\reply.cpp \ + examples\cpp11\http\server2\request_handler.cpp \ + examples\cpp11\http\server2\request_parser.cpp \ + examples\cpp11\http\server2\server.cpp + cl -Fe$@ -Foexamples\cpp11\http\server2\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref + +examples\cpp11\http\server3\http_server.exe: \ + examples\cpp11\http\server3\connection.cpp \ + examples\cpp11\http\server3\main.cpp \ + examples\cpp11\http\server3\mime_types.cpp \ + examples\cpp11\http\server3\reply.cpp \ + examples\cpp11\http\server3\request_handler.cpp \ + examples\cpp11\http\server3\request_parser.cpp \ + examples\cpp11\http\server3\server.cpp + cl -Fe$@ -Foexamples\cpp11\http\server3\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref + +examples\cpp11\http\server4\http_server.exe: \ + examples\cpp11\http\server4\file_handler.cpp \ + examples\cpp11\http\server4\main.cpp \ + examples\cpp11\http\server4\mime_types.cpp \ + examples\cpp11\http\server4\reply.cpp \ + examples\cpp11\http\server4\request_parser.cpp \ + examples\cpp11\http\server4\server.cpp + cl -Fe$@ -Foexamples\cpp11\http\server4\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref + +examples\cpp11\services\daytime_client.exe: \ + examples\cpp11\services\daytime_client.cpp \ + examples\cpp11\services\logger_service.cpp + cl -Fe$@ -Foexamples\cpp11\services\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref clean: -del /q /s asio.lib diff --git a/asio/src/doc/examples.qbk b/asio/src/doc/examples.qbk index 1f5cfde3e3..dc2b94e27e 100644 --- a/asio/src/doc/examples.qbk +++ b/asio/src/doc/examples.qbk @@ -8,18 +8,10 @@ [section:examples Examples] -* [link asio.examples.cpp03_examples C++03 Examples]: Illustrates the use of -Asio using only C++03 language and library features. Where necessary, the +* [link asio.examples.cpp11_examples C++11 Examples]: Illustrates the use of +Asio using only C++11 language and library features. Where necessary, the examples make use of selected Boost C++ libraries. -* [link asio.examples.cpp11_examples 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. -[/boostify: non-boost docs start here] -To show the changes between C++03 and C++11, these examples include a diff -between the C++03 and C++11 versions. -[/boostify: non-boost docs end here] - * [link asio.examples.cpp14_examples 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. @@ -31,7 +23,7 @@ illustrating C++17 usage in conjunction with Technical Specifications. using C++20 language features. -[section:cpp03_examples C++03 Examples] +[section:cpp11_examples C++11 Examples] [heading Allocation] @@ -39,7 +31,7 @@ using C++20 language features. This example shows how to customise the allocation of memory associated with asynchronous operations. -* [@../src/examples/cpp03/allocation/server.cpp] +* [@../src/examples/cpp11/allocation/server.cpp] [heading Buffers] @@ -47,7 +39,7 @@ asynchronous operations. This example demonstrates how to create reference counted buffers that can be used with socket read and write operations. -* [@../src/examples/cpp03/buffers/reference_counted.cpp] +* [@../src/examples/cpp11/buffers/reference_counted.cpp] [heading Chat] @@ -55,15 +47,24 @@ used with socket read and write operations. 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. -* [@../src/examples/cpp03/chat/chat_message.hpp] -* [@../src/examples/cpp03/chat/chat_client.cpp] -* [@../src/examples/cpp03/chat/chat_server.cpp] +* [@../src/examples/cpp11/chat/chat_message.hpp] +* [@../src/examples/cpp11/chat/chat_client.cpp] +* [@../src/examples/cpp11/chat/chat_server.cpp] The following POSIX-specific chat client demonstrates how to use the [link asio.reference.posix__stream_descriptor posix::stream_descriptor] class to perform console input and output. -* [@../src/examples/cpp03/chat/posix_chat_client.cpp] +* [@../src/examples/cpp11/chat/posix_chat_client.cpp] + + +[heading Deferred] + +Examples showing how to use the [link asio.reference.deferred `deferred`] +completion token. + +* [@../src/examples/cpp11/deferred/deferred_1.cpp] +* [@../src/examples/cpp11/deferred/deferred_2.cpp] [heading Echo] @@ -71,12 +72,12 @@ perform console input and output. A collection of simple clients and servers, showing the use of both synchronous and asynchronous operations. -* [@../src/examples/cpp03/echo/async_tcp_echo_server.cpp] -* [@../src/examples/cpp03/echo/async_udp_echo_server.cpp] -* [@../src/examples/cpp03/echo/blocking_tcp_echo_client.cpp] -* [@../src/examples/cpp03/echo/blocking_tcp_echo_server.cpp] -* [@../src/examples/cpp03/echo/blocking_udp_echo_client.cpp] -* [@../src/examples/cpp03/echo/blocking_udp_echo_server.cpp] +* [@../src/examples/cpp11/echo/async_tcp_echo_server.cpp] +* [@../src/examples/cpp11/echo/async_udp_echo_server.cpp] +* [@../src/examples/cpp11/echo/blocking_tcp_echo_client.cpp] +* [@../src/examples/cpp11/echo/blocking_tcp_echo_server.cpp] +* [@../src/examples/cpp11/echo/blocking_udp_echo_client.cpp] +* [@../src/examples/cpp11/echo/blocking_udp_echo_server.cpp] [heading Fork] @@ -85,12 +86,32 @@ 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: -* [@../src/examples/cpp03/fork/daemon.cpp] +* [@../src/examples/cpp11/fork/daemon.cpp] The second example demonstrates how it is possible to fork a process from within a completion handler. -* [@../src/examples/cpp03/fork/process_per_connection.cpp] +* [@../src/examples/cpp11/fork/process_per_connection.cpp] + + +[heading Futures] + +This example demonstrates how to use std::future in conjunction with +Asio's asynchronous operations. + +* [@../src/examples/cpp11/futures/daytime_client.cpp] + + +[heading Handler Tracking] + +This example header file shows how to implement custom handler tracking. + +* [@../src/examples/cpp11/handler_tracking/custom_tracking.hpp] + +This example program shows how to include source location information in +the handler tracking output. + +* [@../src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp] [heading HTTP Client] @@ -99,8 +120,8 @@ Example programs implementing simple HTTP 1.0 clients. These examples show how to use the [link asio.reference.read_until read_until] and [link asio.reference.async_read_until async_read_until] functions. -* [@../src/examples/cpp03/http/client/sync_client.cpp] -* [@../src/examples/cpp03/http/client/async_client.cpp] +* [@../src/examples/cpp11/http/client/sync_client.cpp] +* [@../src/examples/cpp11/http/client/async_client.cpp] [heading HTTP Server] @@ -109,95 +130,95 @@ 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. -* [@../src/examples/cpp03/http/server/connection.cpp] -* [@../src/examples/cpp03/http/server/connection.hpp] -* [@../src/examples/cpp03/http/server/connection_manager.cpp] -* [@../src/examples/cpp03/http/server/connection_manager.hpp] -* [@../src/examples/cpp03/http/server/header.hpp] -* [@../src/examples/cpp03/http/server/main.cpp] -* [@../src/examples/cpp03/http/server/mime_types.cpp] -* [@../src/examples/cpp03/http/server/mime_types.hpp] -* [@../src/examples/cpp03/http/server/reply.cpp] -* [@../src/examples/cpp03/http/server/reply.hpp] -* [@../src/examples/cpp03/http/server/request.hpp] -* [@../src/examples/cpp03/http/server/request_handler.cpp] -* [@../src/examples/cpp03/http/server/request_handler.hpp] -* [@../src/examples/cpp03/http/server/request_parser.cpp] -* [@../src/examples/cpp03/http/server/request_parser.hpp] -* [@../src/examples/cpp03/http/server/server.cpp] -* [@../src/examples/cpp03/http/server/server.hpp] +* [@../src/examples/cpp11/http/server/connection.cpp] +* [@../src/examples/cpp11/http/server/connection.hpp] +* [@../src/examples/cpp11/http/server/connection_manager.cpp] +* [@../src/examples/cpp11/http/server/connection_manager.hpp] +* [@../src/examples/cpp11/http/server/header.hpp] +* [@../src/examples/cpp11/http/server/main.cpp] +* [@../src/examples/cpp11/http/server/mime_types.cpp] +* [@../src/examples/cpp11/http/server/mime_types.hpp] +* [@../src/examples/cpp11/http/server/reply.cpp] +* [@../src/examples/cpp11/http/server/reply.hpp] +* [@../src/examples/cpp11/http/server/request.hpp] +* [@../src/examples/cpp11/http/server/request_handler.cpp] +* [@../src/examples/cpp11/http/server/request_handler.hpp] +* [@../src/examples/cpp11/http/server/request_parser.cpp] +* [@../src/examples/cpp11/http/server/request_parser.hpp] +* [@../src/examples/cpp11/http/server/server.cpp] +* [@../src/examples/cpp11/http/server/server.hpp] [heading HTTP Server 2] An HTTP server using an io_context-per-CPU design. -* [@../src/examples/cpp03/http/server2/connection.cpp] -* [@../src/examples/cpp03/http/server2/connection.hpp] -* [@../src/examples/cpp03/http/server2/header.hpp] -* [@../src/examples/cpp03/http/server2/io_context_pool.cpp] -* [@../src/examples/cpp03/http/server2/io_context_pool.hpp] -* [@../src/examples/cpp03/http/server2/main.cpp] -* [@../src/examples/cpp03/http/server2/mime_types.cpp] -* [@../src/examples/cpp03/http/server2/mime_types.hpp] -* [@../src/examples/cpp03/http/server2/reply.cpp] -* [@../src/examples/cpp03/http/server2/reply.hpp] -* [@../src/examples/cpp03/http/server2/request.hpp] -* [@../src/examples/cpp03/http/server2/request_handler.cpp] -* [@../src/examples/cpp03/http/server2/request_handler.hpp] -* [@../src/examples/cpp03/http/server2/request_parser.cpp] -* [@../src/examples/cpp03/http/server2/request_parser.hpp] -* [@../src/examples/cpp03/http/server2/server.cpp] -* [@../src/examples/cpp03/http/server2/server.hpp] +* [@../src/examples/cpp11/http/server2/connection.cpp] +* [@../src/examples/cpp11/http/server2/connection.hpp] +* [@../src/examples/cpp11/http/server2/header.hpp] +* [@../src/examples/cpp11/http/server2/io_context_pool.cpp] +* [@../src/examples/cpp11/http/server2/io_context_pool.hpp] +* [@../src/examples/cpp11/http/server2/main.cpp] +* [@../src/examples/cpp11/http/server2/mime_types.cpp] +* [@../src/examples/cpp11/http/server2/mime_types.hpp] +* [@../src/examples/cpp11/http/server2/reply.cpp] +* [@../src/examples/cpp11/http/server2/reply.hpp] +* [@../src/examples/cpp11/http/server2/request.hpp] +* [@../src/examples/cpp11/http/server2/request_handler.cpp] +* [@../src/examples/cpp11/http/server2/request_handler.hpp] +* [@../src/examples/cpp11/http/server2/request_parser.cpp] +* [@../src/examples/cpp11/http/server2/request_parser.hpp] +* [@../src/examples/cpp11/http/server2/server.cpp] +* [@../src/examples/cpp11/http/server2/server.hpp] [heading HTTP Server 3] An HTTP server using a single io_context and a thread pool calling `io_context::run()`. -* [@../src/examples/cpp03/http/server3/connection.cpp] -* [@../src/examples/cpp03/http/server3/connection.hpp] -* [@../src/examples/cpp03/http/server3/header.hpp] -* [@../src/examples/cpp03/http/server3/main.cpp] -* [@../src/examples/cpp03/http/server3/mime_types.cpp] -* [@../src/examples/cpp03/http/server3/mime_types.hpp] -* [@../src/examples/cpp03/http/server3/reply.cpp] -* [@../src/examples/cpp03/http/server3/reply.hpp] -* [@../src/examples/cpp03/http/server3/request.hpp] -* [@../src/examples/cpp03/http/server3/request_handler.cpp] -* [@../src/examples/cpp03/http/server3/request_handler.hpp] -* [@../src/examples/cpp03/http/server3/request_parser.cpp] -* [@../src/examples/cpp03/http/server3/request_parser.hpp] -* [@../src/examples/cpp03/http/server3/server.cpp] -* [@../src/examples/cpp03/http/server3/server.hpp] +* [@../src/examples/cpp11/http/server3/connection.cpp] +* [@../src/examples/cpp11/http/server3/connection.hpp] +* [@../src/examples/cpp11/http/server3/header.hpp] +* [@../src/examples/cpp11/http/server3/main.cpp] +* [@../src/examples/cpp11/http/server3/mime_types.cpp] +* [@../src/examples/cpp11/http/server3/mime_types.hpp] +* [@../src/examples/cpp11/http/server3/reply.cpp] +* [@../src/examples/cpp11/http/server3/reply.hpp] +* [@../src/examples/cpp11/http/server3/request.hpp] +* [@../src/examples/cpp11/http/server3/request_handler.cpp] +* [@../src/examples/cpp11/http/server3/request_handler.hpp] +* [@../src/examples/cpp11/http/server3/request_parser.cpp] +* [@../src/examples/cpp11/http/server3/request_parser.hpp] +* [@../src/examples/cpp11/http/server3/server.cpp] +* [@../src/examples/cpp11/http/server3/server.hpp] [heading HTTP Server 4] A single-threaded HTTP server implemented using stackless coroutines. -* [@../src/examples/cpp03/http/server4/file_handler.cpp] -* [@../src/examples/cpp03/http/server4/file_handler.hpp] -* [@../src/examples/cpp03/http/server4/header.hpp] -* [@../src/examples/cpp03/http/server4/main.cpp] -* [@../src/examples/cpp03/http/server4/mime_types.cpp] -* [@../src/examples/cpp03/http/server4/mime_types.hpp] -* [@../src/examples/cpp03/http/server4/reply.cpp] -* [@../src/examples/cpp03/http/server4/reply.hpp] -* [@../src/examples/cpp03/http/server4/request.hpp] -* [@../src/examples/cpp03/http/server4/request_parser.cpp] -* [@../src/examples/cpp03/http/server4/request_parser.hpp] -* [@../src/examples/cpp03/http/server4/server.cpp] -* [@../src/examples/cpp03/http/server4/server.hpp] +* [@../src/examples/cpp11/http/server4/file_handler.cpp] +* [@../src/examples/cpp11/http/server4/file_handler.hpp] +* [@../src/examples/cpp11/http/server4/header.hpp] +* [@../src/examples/cpp11/http/server4/main.cpp] +* [@../src/examples/cpp11/http/server4/mime_types.cpp] +* [@../src/examples/cpp11/http/server4/mime_types.hpp] +* [@../src/examples/cpp11/http/server4/reply.cpp] +* [@../src/examples/cpp11/http/server4/reply.hpp] +* [@../src/examples/cpp11/http/server4/request.hpp] +* [@../src/examples/cpp11/http/server4/request_parser.cpp] +* [@../src/examples/cpp11/http/server4/request_parser.hpp] +* [@../src/examples/cpp11/http/server4/server.cpp] +* [@../src/examples/cpp11/http/server4/server.hpp] [heading ICMP] This example shows how to use raw sockets with ICMP to ping a remote host. -* [@../src/examples/cpp03/icmp/ping.cpp] -* [@../src/examples/cpp03/icmp/ipv4_header.hpp] -* [@../src/examples/cpp03/icmp/icmp_header.hpp] +* [@../src/examples/cpp11/icmp/ping.cpp] +* [@../src/examples/cpp11/icmp/ipv4_header.hpp] +* [@../src/examples/cpp11/icmp/icmp_header.hpp] [heading Invocation] @@ -205,7 +226,7 @@ This example shows how to use raw sockets with ICMP to ping a remote host. This example shows how to customise handler invocation. Completion handlers are added to a priority queue rather than executed immediately. -* [@../src/examples/cpp03/invocation/prioritised_handlers.cpp] +* [@../src/examples/cpp11/invocation/prioritised_handlers.cpp] [heading Iostreams] @@ -213,240 +234,9 @@ added to a priority queue rather than executed immediately. Two examples showing how to use [link asio.reference.ip__tcp.iostream ip::tcp::iostream]. -* [@../src/examples/cpp03/iostreams/daytime_client.cpp] -* [@../src/examples/cpp03/iostreams/daytime_server.cpp] -* [@../src/examples/cpp03/iostreams/http_client.cpp] - - -[heading Multicast] - -An example showing the use of multicast to transmit packets to a group of -subscribers. - -* [@../src/examples/cpp03/multicast/receiver.cpp] -* [@../src/examples/cpp03/multicast/sender.cpp] - - -[heading Serialization] - -This example shows how Boost.Serialization can be used with asio to encode and -decode structures for transmission over a socket. - -* [@../src/examples/cpp03/serialization/client.cpp] -* [@../src/examples/cpp03/serialization/connection.hpp] -* [@../src/examples/cpp03/serialization/server.cpp] -* [@../src/examples/cpp03/serialization/stock.hpp] - - -[heading Services] - -This example demonstrates how to integrate custom functionality (in this case, -for logging) into asio's [link asio.reference.io_context io_context], and -how to use a custom service with [link -asio.reference.basic_stream_socket basic_stream_socket<>]. - -* [@../src/examples/cpp03/services/basic_logger.hpp] -* [@../src/examples/cpp03/services/daytime_client.cpp] -* [@../src/examples/cpp03/services/logger.hpp] -* [@../src/examples/cpp03/services/logger_service.cpp] -* [@../src/examples/cpp03/services/logger_service.hpp] -* [@../src/examples/cpp03/services/stream_socket_service.hpp] - - -[heading SOCKS 4] - -Example client program implementing the SOCKS 4 protocol for communication via -a proxy. - -* [@../src/examples/cpp03/socks4/sync_client.cpp] -* [@../src/examples/cpp03/socks4/socks4.hpp] - - -[heading SSL] - -Example client and server programs showing the use of the [link -asio.reference.ssl__stream ssl::stream<>] template with asynchronous operations. - -* [@../src/examples/cpp03/ssl/client.cpp] -* [@../src/examples/cpp03/ssl/server.cpp] - - -[heading Timeouts] - -A collection of examples showing how to cancel long running asynchronous -operations after a period of time. - -* [@../src/examples/cpp03/timeouts/async_tcp_client.cpp] -* [@../src/examples/cpp03/timeouts/blocking_tcp_client.cpp] -* [@../src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp] -* [@../src/examples/cpp03/timeouts/blocking_udp_client.cpp] -* [@../src/examples/cpp03/timeouts/server.cpp] - - -[heading Timers] - -Example showing how to customise basic_waitable_timer using a different clock type. - -* [@../src/examples/cpp03/timers/time_t_timer.cpp] - - -[heading Porthopper] - -Example illustrating mixed synchronous and asynchronous operations, and how to -use Boost.Lambda with Asio. - -* [@../src/examples/cpp03/porthopper/protocol.hpp] -* [@../src/examples/cpp03/porthopper/client.cpp] -* [@../src/examples/cpp03/porthopper/server.cpp] - - -[heading Nonblocking] - -Example demonstrating reactor-style operations for integrating a third-party -library that wants to perform the I/O operations itself. - -* [@../src/examples/cpp03/nonblocking/third_party_lib.cpp] - - -[heading Spawn] - -Example of using the asio::spawn() function, a wrapper around the -[@http://www.boost.org/doc/libs/release/libs/coroutine/index.html Boost.Coroutine] -library, to implement a chain of asynchronous operations using stackful -coroutines. - -* [@../src/examples/cpp03/spawn/echo_server.cpp] - - -[heading UNIX Domain Sockets] - -Examples showing how to use UNIX domain (local) sockets. - -* [@../src/examples/cpp03/local/connect_pair.cpp] -* [@../src/examples/cpp03/local/iostream_client.cpp] -* [@../src/examples/cpp03/local/stream_server.cpp] -* [@../src/examples/cpp03/local/stream_client.cpp] - - -[heading Windows] - -An example showing how to use the Windows-specific function `TransmitFile` -with Asio. - -* [@../src/examples/cpp03/windows/transmit_file.cpp] - - -[endsect] - - -[section:cpp11_examples C++11 Examples] - - -[heading Allocation] - -This example shows how to customise the allocation of memory associated with -asynchronous operations. - -* [@../src/examples/cpp11/allocation/server.cpp] ([@examples/diffs/allocation/server.cpp.html diff to C++03]) - - -[heading Buffers] - -This example demonstrates how to create reference counted buffers that can be -used with socket read and write operations. - -* [@../src/examples/cpp11/buffers/reference_counted.cpp] ([@examples/diffs/buffers/reference_counted.cpp.html diff to C++03]) - - -[heading 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. - -* [@../src/examples/cpp11/chat/chat_message.hpp] ([@examples/diffs/chat/chat_message.hpp.html diff to C++03]) -* [@../src/examples/cpp11/chat/chat_client.cpp] ([@examples/diffs/chat/chat_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/chat/chat_server.cpp] ([@examples/diffs/chat/chat_server.cpp.html diff to C++03]) - - -[heading Echo] - -A collection of simple clients and servers, showing the use of both synchronous -and asynchronous operations. - -* [@../src/examples/cpp11/echo/async_tcp_echo_server.cpp] ([@examples/diffs/echo/async_tcp_echo_server.cpp.html diff to C++03]) -* [@../src/examples/cpp11/echo/async_udp_echo_server.cpp] ([@examples/diffs/echo/async_udp_echo_server.cpp.html diff to C++03]) -* [@../src/examples/cpp11/echo/blocking_tcp_echo_client.cpp] ([@examples/diffs/echo/blocking_tcp_echo_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/echo/blocking_tcp_echo_server.cpp] ([@examples/diffs/echo/blocking_tcp_echo_server.cpp.html diff to C++03]) -* [@../src/examples/cpp11/echo/blocking_udp_echo_client.cpp] ([@examples/diffs/echo/blocking_udp_echo_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/echo/blocking_udp_echo_server.cpp] ([@examples/diffs/echo/blocking_udp_echo_server.cpp.html diff to C++03]) - - -[heading Deferred] - -Examples showing how to use the [link asio.reference.deferred `deferred`] -completion token. - -* [@../src/examples/cpp11/deferred/deferred_1.cpp] -* [@../src/examples/cpp11/deferred/deferred_2.cpp] - - -[heading 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: - -* [@../src/examples/cpp11/fork/daemon.cpp] ([@examples/diffs/fork/daemon.cpp.html diff to C++03]) - -The second example demonstrates how it is possible to fork a process from -within a completion handler. - -* [@../src/examples/cpp11/fork/process_per_connection.cpp] ([@examples/diffs/fork/process_per_connection.cpp.html diff to C++03]) - - -[heading Futures] - -This example demonstrates how to use std::future in conjunction with -Asio's asynchronous operations. - -* [@../src/examples/cpp11/futures/daytime_client.cpp] - - -[heading Handler Tracking] - -This example header file shows how to implement custom handler tracking. - -* [@../src/examples/cpp11/handler_tracking/custom_tracking.hpp] - -This example program shows how to include source location information in -the handler tracking output. - -* [@../src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp] - - -[heading 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. - -* [@../src/examples/cpp11/http/server/connection.cpp] ([@examples/diffs/http/server/connection.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/connection.hpp] ([@examples/diffs/http/server/connection.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/connection_manager.cpp] ([@examples/diffs/http/server/connection_manager.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/connection_manager.hpp] ([@examples/diffs/http/server/connection_manager.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/header.hpp] ([@examples/diffs/http/server/header.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/main.cpp] ([@examples/diffs/http/server/main.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/mime_types.cpp] ([@examples/diffs/http/server/mime_types.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/mime_types.hpp] ([@examples/diffs/http/server/mime_types.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/reply.cpp] ([@examples/diffs/http/server/reply.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/reply.hpp] ([@examples/diffs/http/server/reply.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/request.hpp] ([@examples/diffs/http/server/request.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/request_handler.cpp] ([@examples/diffs/http/server/request_handler.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/request_handler.hpp] ([@examples/diffs/http/server/request_handler.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/request_parser.cpp] ([@examples/diffs/http/server/request_parser.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/request_parser.hpp] ([@examples/diffs/http/server/request_parser.hpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/server.cpp] ([@examples/diffs/http/server/server.cpp.html diff to C++03]) -* [@../src/examples/cpp11/http/server/server.hpp] ([@examples/diffs/http/server/server.hpp.html diff to C++03]) +* [@../src/examples/cpp11/iostreams/daytime_client.cpp] +* [@../src/examples/cpp11/iostreams/daytime_server.cpp] +* [@../src/examples/cpp11/iostreams/http_client.cpp] [heading Multicast] @@ -454,8 +244,8 @@ cancelling all outstanding asynchronous operations. An example showing the use of multicast to transmit packets to a group of subscribers. -* [@../src/examples/cpp11/multicast/receiver.cpp] ([@examples/diffs/multicast/receiver.cpp.html diff to C++03]) -* [@../src/examples/cpp11/multicast/sender.cpp] ([@examples/diffs/multicast/sender.cpp.html diff to C++03]) +* [@../src/examples/cpp11/multicast/receiver.cpp] +* [@../src/examples/cpp11/multicast/sender.cpp] [heading Nonblocking] @@ -463,7 +253,7 @@ subscribers. Example demonstrating reactor-style operations for integrating a third-party library that wants to perform the I/O operations itself. -* [@../src/examples/cpp11/nonblocking/third_party_lib.cpp] ([@examples/diffs/nonblocking/third_party_lib.cpp.html diff to C++03]) +* [@../src/examples/cpp11/nonblocking/third_party_lib.cpp] [heading Operations] @@ -493,23 +283,58 @@ asio.reference.experimental__make_parallel_group * [@../src/examples/cpp11/parallel_group/ranged_wait_for_all.cpp] +[heading Porthopper] + +Example illustrating mixed synchronous and asynchronous operations. + +* [@../src/examples/cpp11/porthopper/protocol.hpp] +* [@../src/examples/cpp11/porthopper/client.cpp] +* [@../src/examples/cpp11/porthopper/server.cpp] + + +[heading Serialization] + +This example shows how Boost.Serialization can be used with asio to encode and +decode structures for transmission over a socket. + +* [@../src/examples/cpp11/serialization/client.cpp] +* [@../src/examples/cpp11/serialization/connection.hpp] +* [@../src/examples/cpp11/serialization/server.cpp] +* [@../src/examples/cpp11/serialization/stock.hpp] + + +[heading Services] + +This example demonstrates how to integrate custom functionality (in this case, +for logging) into asio's [link asio.reference.io_context io_context], and +how to use a custom service with [link +asio.reference.basic_stream_socket basic_stream_socket<>]. + +* [@../src/examples/cpp11/services/basic_logger.hpp] +* [@../src/examples/cpp11/services/daytime_client.cpp] +* [@../src/examples/cpp11/services/logger.hpp] +* [@../src/examples/cpp11/services/logger_service.cpp] +* [@../src/examples/cpp11/services/logger_service.hpp] +* [@../src/examples/cpp11/services/stream_socket_service.hpp] + + [heading SOCKS 4] Example client program implementing the SOCKS 4 protocol for communication via a proxy. -* [@../src/examples/cpp11/socks4/sync_client.cpp] ([@examples/diffs/socks4/sync_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/socks4/socks4.hpp] ([@examples/diffs/socks4/socks4.hpp.html diff to C++03]) +* [@../src/examples/cpp11/socks4/sync_client.cpp] +* [@../src/examples/cpp11/socks4/socks4.hpp] [heading Spawn] Example of using the asio::spawn() function, a wrapper around the -[@http://www.boost.org/doc/libs/release/libs/coroutine/index.html Boost.Coroutine] +[@http://www.boost.org/doc/libs/release/libs/context/index.html Boost.Context] library, to implement a chain of asynchronous operations using stackful coroutines. -* [@../src/examples/cpp11/spawn/echo_server.cpp] ([@examples/diffs/spawn/echo_server.cpp.html diff to C++03]) +* [@../src/examples/cpp11/spawn/echo_server.cpp] [heading SSL] @@ -517,8 +342,8 @@ coroutines. Example client and server programs showing the use of the [link asio.reference.ssl__stream ssl::stream<>] template with asynchronous operations. -* [@../src/examples/cpp11/ssl/client.cpp] ([@examples/diffs/ssl/client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/ssl/server.cpp] ([@examples/diffs/ssl/server.cpp.html diff to C++03]) +* [@../src/examples/cpp11/ssl/client.cpp] +* [@../src/examples/cpp11/ssl/server.cpp] [heading Timeouts] @@ -526,18 +351,18 @@ asio.reference.ssl__stream ssl::stream<>] template with asynchronous operations. A collection of examples showing how to cancel long running asynchronous operations after a period of time. -* [@../src/examples/cpp11/timeouts/async_tcp_client.cpp] ([@examples/diffs/timeouts/async_tcp_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/timeouts/blocking_tcp_client.cpp] ([@examples/diffs/timeouts/blocking_tcp_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp] ([@examples/diffs/timeouts/blocking_token_tcp_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/timeouts/blocking_udp_client.cpp] ([@examples/diffs/timeouts/blocking_udp_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/timeouts/server.cpp] ([@examples/diffs/timeouts/server.cpp.html diff to C++03]) +* [@../src/examples/cpp11/timeouts/async_tcp_client.cpp] +* [@../src/examples/cpp11/timeouts/blocking_tcp_client.cpp] +* [@../src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp] +* [@../src/examples/cpp11/timeouts/blocking_udp_client.cpp] +* [@../src/examples/cpp11/timeouts/server.cpp] [heading Timers] Example showing how to customise basic_waitable_timer using a different clock type. -* [@../src/examples/cpp11/timers/time_t_timer.cpp] ([@examples/diffs/timers/time_t_timer.cpp.html diff to C++03]) +* [@../src/examples/cpp11/timers/time_t_timer.cpp] [heading Type Erasure] @@ -558,14 +383,22 @@ operations. Examples showing how to use UNIX domain (local) sockets. -* [@../src/examples/cpp11/local/connect_pair.cpp] ([@examples/diffs/local/connect_pair.cpp.html diff to C++03]) -* [@../src/examples/cpp11/local/iostream_client.cpp] ([@examples/diffs/local/iostream_client.cpp.html diff to C++03]) -* [@../src/examples/cpp11/local/stream_server.cpp] ([@examples/diffs/local/stream_server.cpp.html diff to C++03]) -* [@../src/examples/cpp11/local/stream_client.cpp] ([@examples/diffs/local/stream_client.cpp.html diff to C++03]) +* [@../src/examples/cpp11/local/connect_pair.cpp] +* [@../src/examples/cpp11/local/iostream_client.cpp] +* [@../src/examples/cpp11/local/stream_server.cpp] +* [@../src/examples/cpp11/local/stream_client.cpp] * [@../src/examples/cpp11/local/fd_passing_stream_server.cpp] * [@../src/examples/cpp11/local/fd_passing_stream_client.cpp] +[heading Windows] + +An example showing how to use the Windows-specific function `TransmitFile` +with Asio. + +* [@../src/examples/cpp11/windows/transmit_file.cpp] + + [endsect] diff --git a/asio/src/doc/overview/allocation.qbk b/asio/src/doc/overview/allocation.qbk index 47cf45e5db..4db273075b 100644 --- a/asio/src/doc/overview/allocation.qbk +++ b/asio/src/doc/overview/allocation.qbk @@ -89,7 +89,6 @@ responsible for providing the necessary thread safety guarantees.) [link asio.reference.associated_allocator associated_allocator], [link asio.reference.get_associated_allocator get_associated_allocator], -[link asio.examples.cpp03_examples.allocation custom memory allocation example (C++03)], [link asio.examples.cpp11_examples.allocation custom memory allocation example (C++11)]. [endsect] diff --git a/asio/src/doc/overview/buffers.qbk b/asio/src/doc/overview/buffers.qbk index c4c6db6360..e52789a56c 100644 --- a/asio/src/doc/overview/buffers.qbk +++ b/asio/src/doc/overview/buffers.qbk @@ -179,7 +179,6 @@ It can also be explicitly disabled by defining `ASIO_DISABLE_BUFFER_DEBUGGING`. [link asio.reference.streambuf streambuf], [link asio.reference.ConstBufferSequence ConstBufferSequence], [link asio.reference.MutableBufferSequence MutableBufferSequence], -[link asio.examples.cpp03_examples.buffers buffers example (C++03)], [link asio.examples.cpp11_examples.buffers buffers example (c++11)]. [endsect] diff --git a/asio/src/doc/overview/coroutine.qbk b/asio/src/doc/overview/coroutine.qbk index ec3b6e7f3c..bacda75f33 100644 --- a/asio/src/doc/overview/coroutine.qbk +++ b/asio/src/doc/overview/coroutine.qbk @@ -45,7 +45,7 @@ documentation provides a complete description of these pseudo-keywords. [heading See Also] [link asio.reference.coroutine coroutine], -[link asio.examples.cpp03_examples.http_server_4 HTTP Server 4 example], +[link asio.examples.cpp11_examples.http_server_4 HTTP Server 4 example], [link asio.overview.composition.spawn Stackful Coroutines]. [endsect] diff --git a/asio/src/doc/overview/iostreams.qbk b/asio/src/doc/overview/iostreams.qbk index 34ff661035..4074c59080 100644 --- a/asio/src/doc/overview/iostreams.qbk +++ b/asio/src/doc/overview/iostreams.qbk @@ -62,7 +62,7 @@ retrieve the error code from the most recent system call: [link asio.reference.ip__tcp.iostream ip::tcp::iostream], [link asio.reference.basic_socket_iostream basic_socket_iostream], -[link asio.examples.cpp03_examples.iostreams iostreams examples]. +[link asio.examples.cpp11_examples.iostreams iostreams examples]. [heading Notes] diff --git a/asio/src/doc/overview/line_based.qbk b/asio/src/doc/overview/line_based.qbk index ecd72dcba3..9eb465a411 100644 --- a/asio/src/doc/overview/line_based.qbk +++ b/asio/src/doc/overview/line_based.qbk @@ -113,6 +113,6 @@ other types the trait must be explicitly specialised, as shown above. [link asio.reference.is_match_condition is_match_condition], [link asio.reference.read_until read_until()], [link asio.reference.streambuf streambuf], -[link asio.examples.cpp03_examples.http_client HTTP client example]. +[link asio.examples.cpp11_examples.http_client HTTP client example]. [endsect] diff --git a/asio/src/doc/overview/posix.qbk b/asio/src/doc/overview/posix.qbk index 8cf9664a96..765b6aa59e 100644 --- a/asio/src/doc/overview/posix.qbk +++ b/asio/src/doc/overview/posix.qbk @@ -61,7 +61,7 @@ asio.reference.basic_socket.native_handle native_handle()] member function. [link asio.reference.local__stream_protocol.endpoint local::stream_protocol::endpoint], [link asio.reference.local__stream_protocol.iostream local::stream_protocol::iostream], [link asio.reference.local__stream_protocol.socket local::stream_protocol::socket], -[link asio.examples.cpp03_examples.unix_domain_sockets UNIX domain sockets examples]. +[link asio.examples.cpp11_examples.unix_domain_sockets UNIX domain sockets examples]. [heading Notes] @@ -101,7 +101,6 @@ asio.reference.async_read_until async_read_until()] free functions. [heading See Also] [link asio.reference.posix__stream_descriptor posix::stream_descriptor], -[link asio.examples.cpp03_examples.chat Chat example (C++03)], [link asio.examples.cpp11_examples.chat Chat example (C++11)]. [heading Notes] @@ -145,7 +144,7 @@ as required. [link asio.reference.io_context.notify_fork io_context::notify_fork()], [link asio.reference.io_context.fork_event io_context::fork_event], [link asio.reference.execution_context__service.notify_fork io_context::service::notify_fork()], -[link asio.examples.cpp03_examples.fork Fork examples]. +[link asio.examples.cpp11_examples.fork Fork examples]. [endsect] diff --git a/asio/src/doc/overview/protocols.qbk b/asio/src/doc/overview/protocols.qbk index 51aa75755a..deb92e14af 100644 --- a/asio/src/doc/overview/protocols.qbk +++ b/asio/src/doc/overview/protocols.qbk @@ -144,6 +144,6 @@ functions. [link asio.reference.ip__udp ip::udp], [link asio.reference.ip__icmp ip::icmp], [link asio.tutorial.tutdaytime1 daytime protocol tutorials], -[link asio.examples.cpp03_examples.icmp ICMP ping example]. +[link asio.examples.cpp11_examples.icmp ICMP ping example]. [endsect] diff --git a/asio/src/doc/overview/reactor.qbk b/asio/src/doc/overview/reactor.qbk index 16eec38b50..4e67a5d765 100644 --- a/asio/src/doc/overview/reactor.qbk +++ b/asio/src/doc/overview/reactor.qbk @@ -39,6 +39,6 @@ stream-oriented descriptor classes. [link asio.reference.basic_socket.async_wait basic_socket::async_wait()], [link asio.reference.basic_socket.non_blocking basic_socket::non_blocking()], [link asio.reference.basic_socket.native_non_blocking basic_socket::native_non_blocking()], -[link asio.examples.cpp03_examples.nonblocking nonblocking example]. +[link asio.examples.cpp11_examples.nonblocking nonblocking example]. [endsect] diff --git a/asio/src/doc/overview/signals.qbk b/asio/src/doc/overview/signals.qbk index 49d2bd4682..8f3c6cc659 100644 --- a/asio/src/doc/overview/signals.qbk +++ b/asio/src/doc/overview/signals.qbk @@ -38,7 +38,6 @@ library maps console events like Ctrl+C to the equivalent signal. [heading See Also] [link asio.reference.signal_set signal_set], -[link asio.examples.cpp03_examples.http_server HTTP server example (C++03)], [link asio.examples.cpp11_examples.http_server HTTP server example (C++11)]. [endsect] diff --git a/asio/src/doc/overview/spawn.qbk b/asio/src/doc/overview/spawn.qbk index 9d0cc63f42..fbf0f9d97e 100644 --- a/asio/src/doc/overview/spawn.qbk +++ b/asio/src/doc/overview/spawn.qbk @@ -92,7 +92,6 @@ function object signature is actually: [link asio.reference.spawn spawn], [link asio.reference.yield_context yield_context], [link asio.reference.basic_yield_context basic_yield_context], -[link asio.examples.cpp03_examples.spawn Spawn example (C++03)], [link asio.examples.cpp11_examples.spawn Spawn example (C++11)], [link asio.overview.composition.coroutine Stackless Coroutines]. diff --git a/asio/src/doc/overview/ssl.qbk b/asio/src/doc/overview/ssl.qbk index 80651c6781..1b5f3c920a 100644 --- a/asio/src/doc/overview/ssl.qbk +++ b/asio/src/doc/overview/ssl.qbk @@ -110,7 +110,6 @@ threaded programs. [link asio.reference.ssl__context ssl::context], [link asio.reference.ssl__host_name_verification ssl::host_name_verification], [link asio.reference.ssl__stream ssl::stream], -[link asio.examples.cpp03_examples.ssl SSL example (C++03)], [link asio.examples.cpp11_examples.ssl SSL example (C++11)]. [heading Notes] diff --git a/asio/src/doc/overview/strands.qbk b/asio/src/doc/overview/strands.qbk index 8dfa53dd23..81e70f7d07 100644 --- a/asio/src/doc/overview/strands.qbk +++ b/asio/src/doc/overview/strands.qbk @@ -109,6 +109,6 @@ completion handler we would simply write: [link asio.reference.strand strand], [link asio.reference.io_context__strand io_context::strand], [link asio.tutorial.tuttimer5 tutorial Timer.5], -[link asio.examples.cpp03_examples.http_server_3 HTTP server 3 example]. +[link asio.examples.cpp11_examples.http_server_3 HTTP server 3 example]. [endsect] diff --git a/asio/src/doc/tutorial.dox b/asio/src/doc/tutorial.dox index c362f951c1..0295f0e5ee 100644 --- a/asio/src/doc/tutorial.dox +++ b/asio/src/doc/tutorial.dox @@ -114,9 +114,9 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ./../examples/cpp03/tutorial/index_dox.txt \ - ./../examples/cpp03/tutorial/timer_dox.txt \ - ./../examples/cpp03/tutorial/daytime_dox.txt \ +INPUT = ./../examples/cpp11/tutorial/index_dox.txt \ + ./../examples/cpp11/tutorial/timer_dox.txt \ + ./../examples/cpp11/tutorial/daytime_dox.txt \ ./boost_bind_dox.txt INPUT_ENCODING = UTF-8 INPUT_FILE_ENCODING = diff --git a/asio/src/examples/cpp03/Makefile.am b/asio/src/examples/cpp03/Makefile.am deleted file mode 100644 index 0fab176c6f..0000000000 --- a/asio/src/examples/cpp03/Makefile.am +++ /dev/null @@ -1,251 +0,0 @@ -AUTOMAKE_OPTIONS = subdir-objects - -if SEPARATE_COMPILATION -noinst_LIBRARIES = libasio.a -libasio_a_SOURCES = ../../asio.cpp -if HAVE_OPENSSL -libasio_a_SOURCES += ../../asio_ssl.cpp -endif -LDADD = libasio.a -endif - -noinst_PROGRAMS = \ - allocation/server \ - buffers/reference_counted \ - chat/chat_client \ - chat/chat_server \ - echo/async_tcp_echo_server \ - echo/async_udp_echo_server \ - echo/blocking_tcp_echo_client \ - echo/blocking_tcp_echo_server \ - echo/blocking_udp_echo_client \ - echo/blocking_udp_echo_server \ - http/client/async_client \ - http/client/sync_client \ - http/server/http_server \ - http/server2/http_server \ - http/server3/http_server \ - http/server4/http_server \ - icmp/ping \ - invocation/prioritised_handlers \ - iostreams/daytime_client \ - iostreams/daytime_server \ - iostreams/http_client \ - multicast/receiver \ - multicast/sender \ - nonblocking/third_party_lib \ - porthopper/client \ - porthopper/server \ - services/daytime_client \ - socks4/sync_client \ - timeouts/async_tcp_client \ - timeouts/blocking_tcp_client \ - timeouts/blocking_token_tcp_client \ - timeouts/blocking_udp_client \ - timeouts/server \ - timers/time_t_timer \ - tutorial/timer1/timer \ - tutorial/timer2/timer \ - tutorial/timer3/timer \ - tutorial/timer4/timer \ - tutorial/timer5/timer \ - tutorial/daytime1/client \ - tutorial/daytime2/server \ - tutorial/daytime3/server \ - tutorial/daytime4/client \ - tutorial/daytime5/server \ - tutorial/daytime6/server \ - tutorial/daytime7/server - -if !WINDOWS_TARGET -noinst_PROGRAMS += \ - chat/posix_chat_client \ - fork/daemon \ - fork/process_per_connection \ - local/connect_pair \ - local/iostream_client \ - local/stream_server \ - local/stream_client -endif - -if WINDOWS_TARGET -noinst_PROGRAMS += \ - windows/transmit_file -endif - -if HAVE_OPENSSL -noinst_PROGRAMS += \ - ssl/client \ - ssl/server -endif - -if HAVE_BOOST_COROUTINE -noinst_PROGRAMS += \ - spawn/echo_server \ - spawn/parallel_grep -endif - -noinst_HEADERS = \ - chat/chat_message.hpp \ - services/basic_logger.hpp \ - services/logger.hpp \ - services/logger_service.hpp - -AM_CXXFLAGS = -I$(srcdir)/../../../include - -allocation_server_SOURCES = allocation/server.cpp -buffers_reference_counted_SOURCES = buffers/reference_counted.cpp -chat_chat_client_SOURCES = chat/chat_client.cpp -chat_chat_server_SOURCES = chat/chat_server.cpp -echo_async_tcp_echo_server_SOURCES = echo/async_tcp_echo_server.cpp -echo_async_udp_echo_server_SOURCES = echo/async_udp_echo_server.cpp -echo_blocking_tcp_echo_client_SOURCES = echo/blocking_tcp_echo_client.cpp -echo_blocking_tcp_echo_server_SOURCES = echo/blocking_tcp_echo_server.cpp -echo_blocking_udp_echo_client_SOURCES = echo/blocking_udp_echo_client.cpp -echo_blocking_udp_echo_server_SOURCES = echo/blocking_udp_echo_server.cpp -http_client_async_client_SOURCES = http/client/async_client.cpp -http_client_sync_client_SOURCES = http/client/sync_client.cpp -http_server_http_server_SOURCES = \ - http/server/connection.cpp \ - http/server/connection_manager.cpp \ - http/server/main.cpp \ - http/server/mime_types.cpp \ - http/server/reply.cpp \ - http/server/request_handler.cpp \ - http/server/request_parser.cpp \ - http/server/server.cpp -http_server2_http_server_SOURCES = \ - http/server2/connection.cpp \ - http/server2/io_context_pool.cpp \ - http/server2/main.cpp \ - http/server2/mime_types.cpp \ - http/server2/reply.cpp \ - http/server2/request_handler.cpp \ - http/server2/request_parser.cpp \ - http/server2/server.cpp -http_server3_http_server_SOURCES = \ - http/server3/connection.cpp \ - http/server3/main.cpp \ - http/server3/mime_types.cpp \ - http/server3/reply.cpp \ - http/server3/request_handler.cpp \ - http/server3/request_parser.cpp \ - http/server3/server.cpp -http_server4_http_server_SOURCES = \ - http/server4/file_handler.cpp \ - http/server4/main.cpp \ - http/server4/mime_types.cpp \ - http/server4/reply.cpp \ - http/server4/request_parser.cpp \ - http/server4/server.cpp -icmp_ping_SOURCES = icmp/ping.cpp -invocation_prioritised_handlers_SOURCES = invocation/prioritised_handlers.cpp -iostreams_daytime_client_SOURCES = iostreams/daytime_client.cpp -iostreams_daytime_server_SOURCES = iostreams/daytime_server.cpp -iostreams_http_client_SOURCES = iostreams/http_client.cpp -multicast_receiver_SOURCES = multicast/receiver.cpp -multicast_sender_SOURCES = multicast/sender.cpp -nonblocking_third_party_lib_SOURCES = nonblocking/third_party_lib.cpp -porthopper_client_SOURCES = porthopper/client.cpp -porthopper_server_SOURCES = porthopper/server.cpp -services_daytime_client_SOURCES = \ - services/daytime_client.cpp \ - services/logger_service.cpp -socks4_sync_client_SOURCES = socks4/sync_client.cpp -timeouts_async_tcp_client_SOURCES = timeouts/async_tcp_client.cpp -timeouts_blocking_tcp_client_SOURCES = timeouts/blocking_tcp_client.cpp -timeouts_blocking_token_tcp_client_SOURCES = timeouts/blocking_token_tcp_client.cpp -timeouts_blocking_udp_client_SOURCES = timeouts/blocking_udp_client.cpp -timeouts_server_SOURCES = timeouts/server.cpp -timers_time_t_timer_SOURCES = timers/time_t_timer.cpp -tutorial_timer1_timer_SOURCES = tutorial/timer1/timer.cpp -tutorial_timer2_timer_SOURCES = tutorial/timer2/timer.cpp -tutorial_timer3_timer_SOURCES = tutorial/timer3/timer.cpp -tutorial_timer4_timer_SOURCES = tutorial/timer4/timer.cpp -tutorial_timer5_timer_SOURCES = tutorial/timer5/timer.cpp -tutorial_daytime1_client_SOURCES = tutorial/daytime1/client.cpp -tutorial_daytime2_server_SOURCES = tutorial/daytime2/server.cpp -tutorial_daytime3_server_SOURCES = tutorial/daytime3/server.cpp -tutorial_daytime4_client_SOURCES = tutorial/daytime4/client.cpp -tutorial_daytime5_server_SOURCES = tutorial/daytime5/server.cpp -tutorial_daytime6_server_SOURCES = tutorial/daytime6/server.cpp -tutorial_daytime7_server_SOURCES = tutorial/daytime7/server.cpp - -if !WINDOWS_TARGET -chat_posix_chat_client_SOURCES = chat/posix_chat_client.cpp -fork_daemon_SOURCES = fork/daemon.cpp -fork_process_per_connection_SOURCES = fork/process_per_connection.cpp -local_connect_pair_SOURCES = local/connect_pair.cpp -local_iostream_client_SOURCES = local/iostream_client.cpp -local_stream_server_SOURCES = local/stream_server.cpp -local_stream_client_SOURCES = local/stream_client.cpp -endif - -if WINDOWS_TARGET -windows_transmit_file_SOURCES = windows/transmit_file.cpp -endif - -if HAVE_OPENSSL -ssl_client_SOURCES = ssl/client.cpp -ssl_server_SOURCES = ssl/server.cpp -endif - -if HAVE_BOOST_COROUTINE -spawn_echo_server_SOURCES = spawn/echo_server.cpp -spawn_echo_server_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system -spawn_parallel_grep_SOURCES = spawn/parallel_grep.cpp -spawn_parallel_grep_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system -endif - -EXTRA_DIST = \ - http/server/connection.hpp \ - http/server/connection_manager.hpp \ - http/server/header.hpp \ - http/server/mime_types.hpp \ - http/server/reply.hpp \ - http/server/request.hpp \ - http/server/request_handler.hpp \ - http/server/request_parser.hpp \ - http/server/server.hpp \ - http/server2/connection.hpp \ - http/server2/io_context_pool.hpp \ - http/server2/header.hpp \ - http/server2/mime_types.hpp \ - http/server2/reply.hpp \ - http/server2/request.hpp \ - http/server2/request_handler.hpp \ - http/server2/request_parser.hpp \ - http/server2/server.hpp \ - http/server3/connection.hpp \ - http/server3/header.hpp \ - http/server3/mime_types.hpp \ - http/server3/reply.hpp \ - http/server3/request.hpp \ - http/server3/request_handler.hpp \ - http/server3/request_parser.hpp \ - http/server3/server.hpp \ - http/server4/file_handler.hpp \ - http/server4/header.hpp \ - http/server4/mime_types.hpp \ - http/server4/reply.hpp \ - http/server4/request.hpp \ - http/server4/request_parser.hpp \ - http/server4/server.hpp \ - icmp/icmp_header.hpp \ - icmp/ipv4_header.hpp \ - porthopper/protocol.hpp \ - serialization/client.cpp \ - serialization/server.cpp \ - serialization/connection.hpp \ - serialization/stock.hpp \ - services/basic_logger.hpp \ - services/logger.hpp \ - services/logger_service.hpp \ - socks4/socks4.hpp \ - ssl/README \ - ssl/ca.pem \ - ssl/server.pem \ - ssl/dh4096.pem - -MAINTAINERCLEANFILES = \ - $(srcdir)/Makefile.in diff --git a/asio/src/examples/cpp03/allocation/server.cpp b/asio/src/examples/cpp03/allocation/server.cpp deleted file mode 100644 index 320b878afa..0000000000 --- a/asio/src/examples/cpp03/allocation/server.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// -// server.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include "asio.hpp" - -using asio::ip::tcp; - -// Class to manage the memory to be used for handler-based custom allocation. -// It contains a single block of memory which may be returned for allocation -// requests. If the memory is in use when an allocation request is made, the -// allocator delegates allocation to the global heap. -class handler_memory - : private boost::noncopyable -{ -public: - handler_memory() - : in_use_(false) - { - } - - void* allocate(std::size_t size) - { - if (!in_use_ && size < storage_.size) - { - in_use_ = true; - return storage_.address(); - } - else - { - return ::operator new(size); - } - } - - void deallocate(void* pointer) - { - if (pointer == storage_.address()) - { - in_use_ = false; - } - else - { - ::operator delete(pointer); - } - } - -private: - // Storage space used for handler-based custom memory allocation. - boost::aligned_storage<1024> storage_; - - // Whether the handler-based custom allocation storage has been used. - bool in_use_; -}; - -// The allocator to be associated with the handler objects. This allocator only -// needs to satisfy the C++11 minimal allocator requirements, plus rebind when -// targeting C++03. -template -class handler_allocator -{ -public: - typedef T value_type; - - explicit handler_allocator(handler_memory& mem) - : memory_(mem) - { - } - - template - handler_allocator(const handler_allocator& other) - : memory_(other.memory_) - { - } - - template - struct rebind - { - typedef handler_allocator other; - }; - - bool operator==(const handler_allocator& other) const - { - return &memory_ == &other.memory_; - } - - bool operator!=(const handler_allocator& other) const - { - return &memory_ != &other.memory_; - } - - T* allocate(std::size_t n) const - { - return static_cast(memory_.allocate(sizeof(T) * n)); - } - - void deallocate(T* p, std::size_t /*n*/) const - { - return memory_.deallocate(p); - } - -//private: - // The underlying memory. - handler_memory& memory_; -}; - -class session - : public boost::enable_shared_from_this -{ -public: - session(asio::io_context& io_context) - : socket_(io_context) - { - } - - tcp::socket& socket() - { - return socket_; - } - - void start() - { - socket_.async_read_some(asio::buffer(data_), - asio::bind_allocator( - handler_allocator(handler_memory_), - boost::bind(&session::handle_read, - shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred))); - } - - void handle_read(const asio::error_code& error, - size_t bytes_transferred) - { - if (!error) - { - asio::async_write(socket_, - asio::buffer(data_, bytes_transferred), - asio::bind_allocator( - handler_allocator(handler_memory_), - boost::bind(&session::handle_write, - shared_from_this(), - asio::placeholders::error))); - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - socket_.async_read_some(asio::buffer(data_), - asio::bind_allocator( - handler_allocator(handler_memory_), - boost::bind(&session::handle_read, - shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred))); - } - } - -private: - // The socket used to communicate with the client. - tcp::socket socket_; - - // Buffer used to store data received from the client. - boost::array data_; - - // The memory to use for handler-based custom memory allocation. - handler_memory handler_memory_; -}; - -typedef boost::shared_ptr session_ptr; - -class server -{ -public: - server(asio::io_context& io_context, short port) - : io_context_(io_context), - acceptor_(io_context, tcp::endpoint(tcp::v4(), port)) - { - session_ptr new_session(new session(io_context_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - - void handle_accept(session_ptr new_session, - const asio::error_code& error) - { - if (!error) - { - new_session->start(); - } - - new_session.reset(new session(io_context_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - -private: - asio::io_context& io_context_; - tcp::acceptor acceptor_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: server \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/buffers/.gitignore b/asio/src/examples/cpp03/buffers/.gitignore deleted file mode 100644 index abe68c665f..0000000000 --- a/asio/src/examples/cpp03/buffers/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -reference_counted -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/buffers/reference_counted.cpp b/asio/src/examples/cpp03/buffers/reference_counted.cpp deleted file mode 100644 index 82d737a9ca..0000000000 --- a/asio/src/examples/cpp03/buffers/reference_counted.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// -// reference_counted.cpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include - -using asio::ip::tcp; - -// A reference-counted non-modifiable buffer class. -class shared_const_buffer -{ -public: - // Construct from a std::string. - explicit shared_const_buffer(const std::string& data) - : data_(new std::vector(data.begin(), data.end())), - buffer_(asio::buffer(*data_)) - { - } - - // Implement the ConstBufferSequence requirements. - typedef asio::const_buffer value_type; - typedef const asio::const_buffer* const_iterator; - const asio::const_buffer* begin() const { return &buffer_; } - const asio::const_buffer* end() const { return &buffer_ + 1; } - -private: - boost::shared_ptr > data_; - asio::const_buffer buffer_; -}; - -class session - : public boost::enable_shared_from_this -{ -public: - session(asio::io_context& io_context) - : socket_(io_context) - { - } - - tcp::socket& socket() - { - return socket_; - } - - void start() - { - using namespace std; // For time_t, time and ctime. - time_t now = time(0); - shared_const_buffer buffer(ctime(&now)); - asio::async_write(socket_, buffer, - boost::bind(&session::handle_write, shared_from_this())); - } - - void handle_write() - { - } - -private: - // The socket used to communicate with the client. - tcp::socket socket_; -}; - -typedef boost::shared_ptr session_ptr; - -class server -{ -public: - server(asio::io_context& io_context, short port) - : io_context_(io_context), - acceptor_(io_context, tcp::endpoint(tcp::v4(), port)) - { - session_ptr new_session(new session(io_context_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - - void handle_accept(session_ptr new_session, - const asio::error_code& error) - { - if (!error) - { - new_session->start(); - } - - new_session.reset(new session(io_context_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - -private: - asio::io_context& io_context_; - tcp::acceptor acceptor_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: reference_counted \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/chat/chat_client.cpp b/asio/src/examples/cpp03/chat/chat_client.cpp deleted file mode 100644 index 65305c603e..0000000000 --- a/asio/src/examples/cpp03/chat/chat_client.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// -// chat_client.cpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include "asio.hpp" -#include "chat_message.hpp" - -using asio::ip::tcp; - -typedef std::deque chat_message_queue; - -class chat_client -{ -public: - chat_client(asio::io_context& io_context, - const tcp::resolver::results_type& endpoints) - : io_context_(io_context), - socket_(io_context) - { - asio::async_connect(socket_, endpoints, - boost::bind(&chat_client::handle_connect, this, - asio::placeholders::error)); - } - - void write(const chat_message& msg) - { - asio::post(io_context_, - boost::bind(&chat_client::do_write, this, msg)); - } - - void close() - { - asio::post(io_context_, - boost::bind(&chat_client::do_close, this)); - } - -private: - - void handle_connect(const asio::error_code& error) - { - if (!error) - { - asio::async_read(socket_, - asio::buffer(read_msg_.data(), chat_message::header_length), - boost::bind(&chat_client::handle_read_header, this, - asio::placeholders::error)); - } - } - - void handle_read_header(const asio::error_code& error) - { - if (!error && read_msg_.decode_header()) - { - asio::async_read(socket_, - asio::buffer(read_msg_.body(), read_msg_.body_length()), - boost::bind(&chat_client::handle_read_body, this, - asio::placeholders::error)); - } - else - { - do_close(); - } - } - - void handle_read_body(const asio::error_code& error) - { - if (!error) - { - std::cout.write(read_msg_.body(), read_msg_.body_length()); - std::cout << "\n"; - asio::async_read(socket_, - asio::buffer(read_msg_.data(), chat_message::header_length), - boost::bind(&chat_client::handle_read_header, this, - asio::placeholders::error)); - } - else - { - do_close(); - } - } - - void do_write(chat_message msg) - { - bool write_in_progress = !write_msgs_.empty(); - write_msgs_.push_back(msg); - if (!write_in_progress) - { - asio::async_write(socket_, - asio::buffer(write_msgs_.front().data(), - write_msgs_.front().length()), - boost::bind(&chat_client::handle_write, this, - asio::placeholders::error)); - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - write_msgs_.pop_front(); - if (!write_msgs_.empty()) - { - asio::async_write(socket_, - asio::buffer(write_msgs_.front().data(), - write_msgs_.front().length()), - boost::bind(&chat_client::handle_write, this, - asio::placeholders::error)); - } - } - else - { - do_close(); - } - } - - void do_close() - { - socket_.close(); - } - -private: - asio::io_context& io_context_; - tcp::socket socket_; - chat_message read_msg_; - chat_message_queue write_msgs_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: chat_client \n"; - return 1; - } - - asio::io_context io_context; - - tcp::resolver resolver(io_context); - tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]); - - chat_client c(io_context, endpoints); - - asio::thread t(boost::bind(&asio::io_context::run, &io_context)); - - char line[chat_message::max_body_length + 1]; - while (std::cin.getline(line, chat_message::max_body_length + 1)) - { - using namespace std; // For strlen and memcpy. - chat_message msg; - msg.body_length(strlen(line)); - memcpy(msg.body(), line, msg.body_length()); - msg.encode_header(); - c.write(msg); - } - - c.close(); - t.join(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/chat/chat_message.hpp b/asio/src/examples/cpp03/chat/chat_message.hpp deleted file mode 100644 index 0717054fd2..0000000000 --- a/asio/src/examples/cpp03/chat/chat_message.hpp +++ /dev/null @@ -1,96 +0,0 @@ -// -// chat_message.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef CHAT_MESSAGE_HPP -#define CHAT_MESSAGE_HPP - -#include -#include -#include - -class chat_message -{ -public: - enum - { - header_length = 4, - max_body_length = 512 - }; - - chat_message() - : body_length_(0) - { - } - - const char* data() const - { - return data_; - } - - char* data() - { - return data_; - } - - size_t length() const - { - return header_length + body_length_; - } - - const char* body() const - { - return data_ + header_length; - } - - char* body() - { - return data_ + header_length; - } - - size_t body_length() const - { - return body_length_; - } - - void body_length(size_t new_length) - { - body_length_ = new_length; - if (body_length_ > max_body_length) - body_length_ = max_body_length; - } - - bool decode_header() - { - using namespace std; // For strncat and atoi. - char header[header_length + 1] = ""; - strncat(header, data_, header_length); - body_length_ = atoi(header); - if (body_length_ > max_body_length) - { - body_length_ = 0; - return false; - } - return true; - } - - void encode_header() - { - using namespace std; // For sprintf and memcpy. - char header[header_length + 1] = ""; - sprintf(header, "%4d", static_cast(body_length_)); - memcpy(data_, header, header_length); - } - -private: - char data_[header_length + max_body_length]; - size_t body_length_; -}; - -#endif // CHAT_MESSAGE_HPP diff --git a/asio/src/examples/cpp03/chat/chat_server.cpp b/asio/src/examples/cpp03/chat/chat_server.cpp deleted file mode 100644 index 4d2b5aaf71..0000000000 --- a/asio/src/examples/cpp03/chat/chat_server.cpp +++ /dev/null @@ -1,249 +0,0 @@ -// -// chat_server.cpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include "asio.hpp" -#include "chat_message.hpp" - -using asio::ip::tcp; - -//---------------------------------------------------------------------- - -typedef std::deque chat_message_queue; - -//---------------------------------------------------------------------- - -class chat_participant -{ -public: - virtual ~chat_participant() {} - virtual void deliver(const chat_message& msg) = 0; -}; - -typedef boost::shared_ptr chat_participant_ptr; - -//---------------------------------------------------------------------- - -class chat_room -{ -public: - void join(chat_participant_ptr participant) - { - participants_.insert(participant); - std::for_each(recent_msgs_.begin(), recent_msgs_.end(), - boost::bind(&chat_participant::deliver, - participant, boost::placeholders::_1)); - } - - void leave(chat_participant_ptr participant) - { - participants_.erase(participant); - } - - void deliver(const chat_message& msg) - { - recent_msgs_.push_back(msg); - while (recent_msgs_.size() > max_recent_msgs) - recent_msgs_.pop_front(); - - std::for_each(participants_.begin(), participants_.end(), - boost::bind(&chat_participant::deliver, - boost::placeholders::_1, boost::ref(msg))); - } - -private: - std::set participants_; - enum { max_recent_msgs = 100 }; - chat_message_queue recent_msgs_; -}; - -//---------------------------------------------------------------------- - -class chat_session - : public chat_participant, - public boost::enable_shared_from_this -{ -public: - chat_session(asio::io_context& io_context, chat_room& room) - : socket_(io_context), - room_(room) - { - } - - tcp::socket& socket() - { - return socket_; - } - - void start() - { - room_.join(shared_from_this()); - asio::async_read(socket_, - asio::buffer(read_msg_.data(), chat_message::header_length), - boost::bind( - &chat_session::handle_read_header, shared_from_this(), - asio::placeholders::error)); - } - - void deliver(const chat_message& msg) - { - bool write_in_progress = !write_msgs_.empty(); - write_msgs_.push_back(msg); - if (!write_in_progress) - { - asio::async_write(socket_, - asio::buffer(write_msgs_.front().data(), - write_msgs_.front().length()), - boost::bind(&chat_session::handle_write, shared_from_this(), - asio::placeholders::error)); - } - } - - void handle_read_header(const asio::error_code& error) - { - if (!error && read_msg_.decode_header()) - { - asio::async_read(socket_, - asio::buffer(read_msg_.body(), read_msg_.body_length()), - boost::bind(&chat_session::handle_read_body, shared_from_this(), - asio::placeholders::error)); - } - else - { - room_.leave(shared_from_this()); - } - } - - void handle_read_body(const asio::error_code& error) - { - if (!error) - { - room_.deliver(read_msg_); - asio::async_read(socket_, - asio::buffer(read_msg_.data(), chat_message::header_length), - boost::bind(&chat_session::handle_read_header, shared_from_this(), - asio::placeholders::error)); - } - else - { - room_.leave(shared_from_this()); - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - write_msgs_.pop_front(); - if (!write_msgs_.empty()) - { - asio::async_write(socket_, - asio::buffer(write_msgs_.front().data(), - write_msgs_.front().length()), - boost::bind(&chat_session::handle_write, shared_from_this(), - asio::placeholders::error)); - } - } - else - { - room_.leave(shared_from_this()); - } - } - -private: - tcp::socket socket_; - chat_room& room_; - chat_message read_msg_; - chat_message_queue write_msgs_; -}; - -typedef boost::shared_ptr chat_session_ptr; - -//---------------------------------------------------------------------- - -class chat_server -{ -public: - chat_server(asio::io_context& io_context, - const tcp::endpoint& endpoint) - : io_context_(io_context), - acceptor_(io_context, endpoint) - { - start_accept(); - } - - void start_accept() - { - chat_session_ptr new_session(new chat_session(io_context_, room_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&chat_server::handle_accept, this, new_session, - asio::placeholders::error)); - } - - void handle_accept(chat_session_ptr session, - const asio::error_code& error) - { - if (!error) - { - session->start(); - } - - start_accept(); - } - -private: - asio::io_context& io_context_; - tcp::acceptor acceptor_; - chat_room room_; -}; - -typedef boost::shared_ptr chat_server_ptr; -typedef std::list chat_server_list; - -//---------------------------------------------------------------------- - -int main(int argc, char* argv[]) -{ - try - { - if (argc < 2) - { - std::cerr << "Usage: chat_server [ ...]\n"; - return 1; - } - - asio::io_context io_context; - - chat_server_list servers; - for (int i = 1; i < argc; ++i) - { - using namespace std; // For atoi. - tcp::endpoint endpoint(tcp::v4(), atoi(argv[i])); - chat_server_ptr server(new chat_server(io_context, endpoint)); - servers.push_back(server); - } - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/chat/posix_chat_client.cpp b/asio/src/examples/cpp03/chat/posix_chat_client.cpp deleted file mode 100644 index a579eac221..0000000000 --- a/asio/src/examples/cpp03/chat/posix_chat_client.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// -// posix_chat_client.cpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include "asio.hpp" -#include "chat_message.hpp" - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - -using asio::ip::tcp; -namespace posix = asio::posix; - -class posix_chat_client -{ -public: - posix_chat_client(asio::io_context& io_context, - const tcp::resolver::results_type& endpoints) - : socket_(io_context), - input_(io_context, ::dup(STDIN_FILENO)), - output_(io_context, ::dup(STDOUT_FILENO)), - input_buffer_(chat_message::max_body_length) - { - asio::async_connect(socket_, endpoints, - boost::bind(&posix_chat_client::handle_connect, this, - asio::placeholders::error)); - } - -private: - - void handle_connect(const asio::error_code& error) - { - if (!error) - { - // Read the fixed-length header of the next message from the server. - asio::async_read(socket_, - asio::buffer(read_msg_.data(), chat_message::header_length), - boost::bind(&posix_chat_client::handle_read_header, this, - asio::placeholders::error)); - - // Read a line of input entered by the user. - asio::async_read_until(input_, input_buffer_, '\n', - boost::bind(&posix_chat_client::handle_read_input, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - - void handle_read_header(const asio::error_code& error) - { - if (!error && read_msg_.decode_header()) - { - // Read the variable-length body of the message from the server. - asio::async_read(socket_, - asio::buffer(read_msg_.body(), read_msg_.body_length()), - boost::bind(&posix_chat_client::handle_read_body, this, - asio::placeholders::error)); - } - else - { - close(); - } - } - - void handle_read_body(const asio::error_code& error) - { - if (!error) - { - // Write out the message we just received, terminated by a newline. - static char eol[] = { '\n' }; - boost::array buffers = {{ - asio::buffer(read_msg_.body(), read_msg_.body_length()), - asio::buffer(eol) }}; - asio::async_write(output_, buffers, - boost::bind(&posix_chat_client::handle_write_output, this, - asio::placeholders::error)); - } - else - { - close(); - } - } - - void handle_write_output(const asio::error_code& error) - { - if (!error) - { - // Read the fixed-length header of the next message from the server. - asio::async_read(socket_, - asio::buffer(read_msg_.data(), chat_message::header_length), - boost::bind(&posix_chat_client::handle_read_header, this, - asio::placeholders::error)); - } - else - { - close(); - } - } - - void handle_read_input(const asio::error_code& error, - std::size_t length) - { - if (!error) - { - // Write the message (minus the newline) to the server. - write_msg_.body_length(length - 1); - input_buffer_.sgetn(write_msg_.body(), length - 1); - input_buffer_.consume(1); // Remove newline from input. - write_msg_.encode_header(); - asio::async_write(socket_, - asio::buffer(write_msg_.data(), write_msg_.length()), - boost::bind(&posix_chat_client::handle_write, this, - asio::placeholders::error)); - } - else if (error == asio::error::not_found) - { - // Didn't get a newline. Send whatever we have. - write_msg_.body_length(input_buffer_.size()); - input_buffer_.sgetn(write_msg_.body(), input_buffer_.size()); - write_msg_.encode_header(); - asio::async_write(socket_, - asio::buffer(write_msg_.data(), write_msg_.length()), - boost::bind(&posix_chat_client::handle_write, this, - asio::placeholders::error)); - } - else - { - close(); - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - // Read a line of input entered by the user. - asio::async_read_until(input_, input_buffer_, '\n', - boost::bind(&posix_chat_client::handle_read_input, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - close(); - } - } - - void close() - { - // Cancel all outstanding asynchronous operations. - socket_.close(); - input_.close(); - output_.close(); - } - -private: - tcp::socket socket_; - posix::stream_descriptor input_; - posix::stream_descriptor output_; - chat_message read_msg_; - chat_message write_msg_; - asio::streambuf input_buffer_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: posix_chat_client \n"; - return 1; - } - - asio::io_context io_context; - - tcp::resolver resolver(io_context); - tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]); - - posix_chat_client c(io_context, endpoints); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} - -#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) -int main() {} -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) diff --git a/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp b/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp deleted file mode 100644 index cfafc674aa..0000000000 --- a/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// -// async_tcp_echo_server.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" - -using asio::ip::tcp; - -class session -{ -public: - session(asio::io_context& io_context) - : socket_(io_context) - { - } - - tcp::socket& socket() - { - return socket_; - } - - void start() - { - socket_.async_read_some(asio::buffer(data_, max_length), - boost::bind(&session::handle_read, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - -private: - void handle_read(const asio::error_code& error, - size_t bytes_transferred) - { - if (!error) - { - asio::async_write(socket_, - asio::buffer(data_, bytes_transferred), - boost::bind(&session::handle_write, this, - asio::placeholders::error)); - } - else - { - delete this; - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - socket_.async_read_some(asio::buffer(data_, max_length), - boost::bind(&session::handle_read, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - delete this; - } - } - - tcp::socket socket_; - enum { max_length = 1024 }; - char data_[max_length]; -}; - -class server -{ -public: - server(asio::io_context& io_context, short port) - : io_context_(io_context), - acceptor_(io_context, tcp::endpoint(tcp::v4(), port)) - { - start_accept(); - } - -private: - void start_accept() - { - session* new_session = new session(io_context_); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - - void handle_accept(session* new_session, - const asio::error_code& error) - { - if (!error) - { - new_session->start(); - } - else - { - delete new_session; - } - - start_accept(); - } - - asio::io_context& io_context_; - tcp::acceptor acceptor_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: async_tcp_echo_server \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp b/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp deleted file mode 100644 index d0202324bc..0000000000 --- a/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// async_udp_echo_server.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" - -using asio::ip::udp; - -class server -{ -public: - server(asio::io_context& io_context, short port) - : socket_(io_context, udp::endpoint(udp::v4(), port)) - { - socket_.async_receive_from( - asio::buffer(data_, max_length), sender_endpoint_, - boost::bind(&server::handle_receive_from, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - - void handle_receive_from(const asio::error_code& error, - size_t bytes_recvd) - { - if (!error && bytes_recvd > 0) - { - socket_.async_send_to( - asio::buffer(data_, bytes_recvd), sender_endpoint_, - boost::bind(&server::handle_send_to, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - socket_.async_receive_from( - asio::buffer(data_, max_length), sender_endpoint_, - boost::bind(&server::handle_receive_from, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - - void handle_send_to(const asio::error_code& /*error*/, - size_t /*bytes_sent*/) - { - socket_.async_receive_from( - asio::buffer(data_, max_length), sender_endpoint_, - boost::bind(&server::handle_receive_from, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - -private: - udp::socket socket_; - udp::endpoint sender_endpoint_; - enum { max_length = 1024 }; - char data_[max_length]; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: async_udp_echo_server \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp b/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp deleted file mode 100644 index b7a02b661f..0000000000 --- a/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// blocking_tcp_echo_client.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" - -using asio::ip::tcp; - -enum { max_length = 1024 }; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: blocking_tcp_echo_client \n"; - return 1; - } - - asio::io_context io_context; - - tcp::resolver resolver(io_context); - tcp::resolver::results_type endpoints = - resolver.resolve(tcp::v4(), argv[1], argv[2]); - - tcp::socket s(io_context); - asio::connect(s, endpoints); - - using namespace std; // For strlen. - std::cout << "Enter message: "; - char request[max_length]; - std::cin.getline(request, max_length); - size_t request_length = strlen(request); - asio::write(s, asio::buffer(request, request_length)); - - char reply[max_length]; - size_t reply_length = asio::read(s, - asio::buffer(reply, request_length)); - std::cout << "Reply is: "; - std::cout.write(reply, reply_length); - std::cout << "\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp b/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp deleted file mode 100644 index 417e38b287..0000000000 --- a/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// blocking_tcp_echo_server.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include "asio.hpp" - -using asio::ip::tcp; - -const int max_length = 1024; - -typedef boost::shared_ptr socket_ptr; - -void session(socket_ptr sock) -{ - try - { - for (;;) - { - char data[max_length]; - - asio::error_code error; - size_t length = sock->read_some(asio::buffer(data), error); - if (error == asio::error::eof) - break; // Connection closed cleanly by peer. - else if (error) - throw asio::system_error(error); // Some other error. - - asio::write(*sock, asio::buffer(data, length)); - } - } - catch (std::exception& e) - { - std::cerr << "Exception in thread: " << e.what() << "\n"; - } -} - -void server(asio::io_context& io_context, unsigned short port) -{ - tcp::acceptor a(io_context, tcp::endpoint(tcp::v4(), port)); - for (;;) - { - socket_ptr sock(new tcp::socket(io_context)); - a.accept(*sock); - asio::thread t(boost::bind(session, sock)); - } -} - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: blocking_tcp_echo_server \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server(io_context, atoi(argv[1])); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp b/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp deleted file mode 100644 index d9b1ad71bb..0000000000 --- a/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// blocking_udp_echo_client.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" - -using asio::ip::udp; - -enum { max_length = 1024 }; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: blocking_udp_echo_client \n"; - return 1; - } - - asio::io_context io_context; - - udp::socket s(io_context, udp::endpoint(udp::v4(), 0)); - - udp::resolver resolver(io_context); - udp::resolver::results_type endpoints = - resolver.resolve(udp::v4(), argv[1], argv[2]); - - using namespace std; // For strlen. - std::cout << "Enter message: "; - char request[max_length]; - std::cin.getline(request, max_length); - size_t request_length = strlen(request); - s.send_to(asio::buffer(request, request_length), *endpoints.begin()); - - char reply[max_length]; - udp::endpoint sender_endpoint; - size_t reply_length = s.receive_from( - asio::buffer(reply, max_length), sender_endpoint); - std::cout << "Reply is: "; - std::cout.write(reply, reply_length); - std::cout << "\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp b/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp deleted file mode 100644 index aa223aa7c1..0000000000 --- a/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// blocking_udp_echo_server.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include "asio.hpp" - -using asio::ip::udp; - -enum { max_length = 1024 }; - -void server(asio::io_context& io_context, unsigned short port) -{ - udp::socket sock(io_context, udp::endpoint(udp::v4(), port)); - for (;;) - { - char data[max_length]; - udp::endpoint sender_endpoint; - size_t length = sock.receive_from( - asio::buffer(data, max_length), sender_endpoint); - sock.send_to(asio::buffer(data, length), sender_endpoint); - } -} - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: blocking_udp_echo_server \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server(io_context, atoi(argv[1])); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/fork/.gitignore b/asio/src/examples/cpp03/fork/.gitignore deleted file mode 100644 index 6b565fe313..0000000000 --- a/asio/src/examples/cpp03/fork/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*.ilk -*.manifest -*.pdb -*.tds -daemon -process_per_connection diff --git a/asio/src/examples/cpp03/fork/daemon.cpp b/asio/src/examples/cpp03/fork/daemon.cpp deleted file mode 100644 index d0f98fdf75..0000000000 --- a/asio/src/examples/cpp03/fork/daemon.cpp +++ /dev/null @@ -1,190 +0,0 @@ -// -// daemon.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include - -using asio::ip::udp; - -class udp_daytime_server -{ -public: - udp_daytime_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_daytime_server::handle_receive, - this, boost::placeholders::_1)); - } - - void handle_receive(const asio::error_code& ec) - { - if (!ec) - { - using namespace std; // For time_t, time and ctime; - time_t now = time(0); - std::string message = ctime(&now); - - asio::error_code ignored_ec; - socket_.send_to(asio::buffer(message), - remote_endpoint_, 0, ignored_ec); - } - - start_receive(); - } - - udp::socket socket_; - udp::endpoint remote_endpoint_; - boost::array recv_buffer_; -}; - -int main() -{ - try - { - asio::io_context io_context; - - // Initialise the server before becoming a daemon. If the process is - // started from a shell, this means any errors will be reported back to the - // user. - udp_daytime_server server(io_context); - - // Register signal handlers so that the daemon may be shut down. You may - // also want to register for other signals, such as SIGHUP to trigger a - // re-read of a configuration file. - asio::signal_set signals(io_context, SIGINT, SIGTERM); - signals.async_wait( - boost::bind(&asio::io_context::stop, &io_context)); - - // Inform the io_context that we are about to become a daemon. The - // io_context cleans up any internal resources, such as threads, that may - // interfere with forking. - io_context.notify_fork(asio::io_context::fork_prepare); - - // Fork the process and have the parent exit. If the process was started - // from a shell, this returns control to the user. Forking a new process is - // also a prerequisite for the subsequent call to setsid(). - if (pid_t pid = fork()) - { - if (pid > 0) - { - // We're in the parent process and need to exit. - // - // When the exit() function is used, the program terminates without - // invoking local variables' destructors. Only global variables are - // destroyed. As the io_context object is a local variable, this means - // we do not have to call: - // - // io_context.notify_fork(asio::io_context::fork_parent); - // - // However, this line should be added before each call to exit() if - // using a global io_context object. An additional call: - // - // io_context.notify_fork(asio::io_context::fork_prepare); - // - // should also precede the second fork(). - exit(0); - } - else - { - syslog(LOG_ERR | LOG_USER, "First fork failed: %m"); - return 1; - } - } - - // Make the process a new session leader. This detaches it from the - // terminal. - setsid(); - - // A process inherits its working directory from its parent. This could be - // on a mounted filesystem, which means that the running daemon would - // prevent this filesystem from being unmounted. Changing to the root - // directory avoids this problem. - chdir("/"); - - // The file mode creation mask is also inherited from the parent process. - // We don't want to restrict the permissions on files created by the - // daemon, so the mask is cleared. - umask(0); - - // A second fork ensures the process cannot acquire a controlling terminal. - if (pid_t pid = fork()) - { - if (pid > 0) - { - exit(0); - } - else - { - syslog(LOG_ERR | LOG_USER, "Second fork failed: %m"); - return 1; - } - } - - // Close the standard streams. This decouples the daemon from the terminal - // that started it. - close(0); - close(1); - close(2); - - // We don't want the daemon to have any standard input. - if (open("/dev/null", O_RDONLY) < 0) - { - syslog(LOG_ERR | LOG_USER, "Unable to open /dev/null: %m"); - return 1; - } - - // Send standard output to a log file. - const char* output = "/tmp/asio.daemon.out"; - const int flags = O_WRONLY | O_CREAT | O_APPEND; - const mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - if (open(output, flags, mode) < 0) - { - syslog(LOG_ERR | LOG_USER, "Unable to open output file %s: %m", output); - return 1; - } - - // Also send standard error to the same log file. - if (dup(1) < 0) - { - syslog(LOG_ERR | LOG_USER, "Unable to dup output descriptor: %m"); - return 1; - } - - // Inform the io_context that we have finished becoming a daemon. The - // io_context uses this opportunity to create any internal file descriptors - // that need to be private to the new process. - io_context.notify_fork(asio::io_context::fork_child); - - // The io_context can now be used normally. - syslog(LOG_INFO | LOG_USER, "Daemon started"); - io_context.run(); - syslog(LOG_INFO | LOG_USER, "Daemon stopped"); - } - catch (std::exception& e) - { - syslog(LOG_ERR | LOG_USER, "Exception: %s", e.what()); - std::cerr << "Exception: " << e.what() << std::endl; - } -} diff --git a/asio/src/examples/cpp03/fork/process_per_connection.cpp b/asio/src/examples/cpp03/fork/process_per_connection.cpp deleted file mode 100644 index 5b853b4941..0000000000 --- a/asio/src/examples/cpp03/fork/process_per_connection.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// -// process_per_connection.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using asio::ip::tcp; - -class server -{ -public: - server(asio::io_context& io_context, unsigned short port) - : io_context_(io_context), - signal_(io_context, SIGCHLD), - acceptor_(io_context, tcp::endpoint(tcp::v4(), port)), - socket_(io_context) - { - start_signal_wait(); - start_accept(); - } - -private: - void start_signal_wait() - { - signal_.async_wait(boost::bind(&server::handle_signal_wait, this)); - } - - void handle_signal_wait() - { - // Only the parent process should check for this signal. We can determine - // whether we are in the parent by checking if the acceptor is still open. - if (acceptor_.is_open()) - { - // Reap completed child processes so that we don't end up with zombies. - int status = 0; - while (waitpid(-1, &status, WNOHANG) > 0) {} - - start_signal_wait(); - } - } - - void start_accept() - { - acceptor_.async_accept(socket_, - boost::bind(&server::handle_accept, this, boost::placeholders::_1)); - } - - void handle_accept(const asio::error_code& ec) - { - if (!ec) - { - // Inform the io_context that we are about to fork. The io_context cleans - // up any internal resources, such as threads, that may interfere with - // forking. - io_context_.notify_fork(asio::io_context::fork_prepare); - - if (fork() == 0) - { - // Inform the io_context that the fork is finished and that this is the - // child process. The io_context uses this opportunity to create any - // internal file descriptors that must be private to the new process. - io_context_.notify_fork(asio::io_context::fork_child); - - // The child won't be accepting new connections, so we can close the - // acceptor. It remains open in the parent. - acceptor_.close(); - - // The child process is not interested in processing the SIGCHLD signal. - signal_.cancel(); - - start_read(); - } - else - { - // Inform the io_context that the fork is finished (or failed) and that - // this is the parent process. The io_context uses this opportunity to - // recreate any internal resources that were cleaned up during - // preparation for the fork. - io_context_.notify_fork(asio::io_context::fork_parent); - - socket_.close(); - start_accept(); - } - } - else - { - std::cerr << "Accept error: " << ec.message() << std::endl; - start_accept(); - } - } - - void start_read() - { - socket_.async_read_some(asio::buffer(data_), - boost::bind(&server::handle_read, this, - boost::placeholders::_1, boost::placeholders::_2)); - } - - void handle_read(const asio::error_code& ec, std::size_t length) - { - if (!ec) - start_write(length); - } - - void start_write(std::size_t length) - { - asio::async_write(socket_, asio::buffer(data_, length), - boost::bind(&server::handle_write, this, boost::placeholders::_1)); - } - - void handle_write(const asio::error_code& ec) - { - if (!ec) - start_read(); - } - - asio::io_context& io_context_; - asio::signal_set signal_; - tcp::acceptor acceptor_; - tcp::socket socket_; - boost::array data_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: process_per_connection \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << std::endl; - } -} diff --git a/asio/src/examples/cpp03/http/server/connection.cpp b/asio/src/examples/cpp03/http/server/connection.cpp deleted file mode 100644 index f8666d3e35..0000000000 --- a/asio/src/examples/cpp03/http/server/connection.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// -// connection.cpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "connection.hpp" -#include -#include -#include "connection_manager.hpp" -#include "request_handler.hpp" - -namespace http { -namespace server { - -connection::connection(asio::io_context& io_context, - connection_manager& manager, request_handler& handler) - : socket_(io_context), - connection_manager_(manager), - request_handler_(handler) -{ -} - -asio::ip::tcp::socket& connection::socket() -{ - return socket_; -} - -void connection::start() -{ - socket_.async_read_some(asio::buffer(buffer_), - boost::bind(&connection::handle_read, shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); -} - -void connection::stop() -{ - socket_.close(); -} - -void connection::handle_read(const asio::error_code& e, - std::size_t bytes_transferred) -{ - if (!e) - { - boost::tribool result; - boost::tie(result, boost::tuples::ignore) = request_parser_.parse( - request_, buffer_.data(), buffer_.data() + bytes_transferred); - - if (result) - { - request_handler_.handle_request(request_, reply_); - asio::async_write(socket_, reply_.to_buffers(), - boost::bind(&connection::handle_write, shared_from_this(), - asio::placeholders::error)); - } - else if (!result) - { - reply_ = reply::stock_reply(reply::bad_request); - asio::async_write(socket_, reply_.to_buffers(), - boost::bind(&connection::handle_write, shared_from_this(), - asio::placeholders::error)); - } - else - { - socket_.async_read_some(asio::buffer(buffer_), - boost::bind(&connection::handle_read, shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - else if (e != asio::error::operation_aborted) - { - connection_manager_.stop(shared_from_this()); - } -} - -void connection::handle_write(const asio::error_code& e) -{ - if (!e) - { - // Initiate graceful connection closure. - asio::error_code ignored_ec; - socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); - } - - if (e != asio::error::operation_aborted) - { - connection_manager_.stop(shared_from_this()); - } -} - -} // namespace server -} // namespace http diff --git a/asio/src/examples/cpp03/http/server/connection.hpp b/asio/src/examples/cpp03/http/server/connection.hpp deleted file mode 100644 index be89e0a85a..0000000000 --- a/asio/src/examples/cpp03/http/server/connection.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// -// connection.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_CONNECTION_HPP -#define HTTP_CONNECTION_HPP - -#include -#include -#include -#include -#include -#include "reply.hpp" -#include "request.hpp" -#include "request_handler.hpp" -#include "request_parser.hpp" - -namespace http { -namespace server { - -class connection_manager; - -/// Represents a single connection from a client. -class connection - : public boost::enable_shared_from_this, - private boost::noncopyable -{ -public: - /// Construct a connection with the given io_context. - explicit connection(asio::io_context& io_context, - connection_manager& manager, request_handler& handler); - - /// Get the socket associated with the connection. - asio::ip::tcp::socket& socket(); - - /// Start the first asynchronous operation for the connection. - void start(); - - /// Stop all asynchronous operations associated with the connection. - void stop(); - -private: - /// Handle completion of a read operation. - void handle_read(const asio::error_code& e, - std::size_t bytes_transferred); - - /// Handle completion of a write operation. - void handle_write(const asio::error_code& e); - - /// Socket for the connection. - asio::ip::tcp::socket socket_; - - /// The manager for this connection. - connection_manager& connection_manager_; - - /// The handler used to process the incoming request. - request_handler& request_handler_; - - /// Buffer for incoming data. - boost::array buffer_; - - /// The incoming request. - request request_; - - /// The parser for the incoming request. - request_parser request_parser_; - - /// The reply to be sent back to the client. - reply reply_; -}; - -typedef boost::shared_ptr connection_ptr; - -} // namespace server -} // namespace http - -#endif // HTTP_CONNECTION_HPP diff --git a/asio/src/examples/cpp03/http/server/connection_manager.cpp b/asio/src/examples/cpp03/http/server/connection_manager.cpp deleted file mode 100644 index 001acab343..0000000000 --- a/asio/src/examples/cpp03/http/server/connection_manager.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// connection_manager.cpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "connection_manager.hpp" -#include -#include - -namespace http { -namespace server { - -void connection_manager::start(connection_ptr c) -{ - connections_.insert(c); - c->start(); -} - -void connection_manager::stop(connection_ptr c) -{ - connections_.erase(c); - c->stop(); -} - -void connection_manager::stop_all() -{ - std::for_each(connections_.begin(), connections_.end(), - boost::bind(&connection::stop, boost::placeholders::_1)); - connections_.clear(); -} - -} // namespace server -} // namespace http diff --git a/asio/src/examples/cpp03/http/server/connection_manager.hpp b/asio/src/examples/cpp03/http/server/connection_manager.hpp deleted file mode 100644 index d806ad226c..0000000000 --- a/asio/src/examples/cpp03/http/server/connection_manager.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// connection_manager.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_CONNECTION_MANAGER_HPP -#define HTTP_CONNECTION_MANAGER_HPP - -#include -#include -#include "connection.hpp" - -namespace http { -namespace server { - -/// Manages open connections so that they may be cleanly stopped when the server -/// needs to shut down. -class connection_manager - : private boost::noncopyable -{ -public: - /// Add the specified connection to the manager and start it. - void start(connection_ptr c); - - /// Stop the specified connection. - void stop(connection_ptr c); - - /// Stop all connections. - void stop_all(); - -private: - /// The managed connections. - std::set connections_; -}; - -} // namespace server -} // namespace http - -#endif // HTTP_CONNECTION_MANAGER_HPP diff --git a/asio/src/examples/cpp03/http/server/header.hpp b/asio/src/examples/cpp03/http/server/header.hpp deleted file mode 100644 index 21ddfc47e4..0000000000 --- a/asio/src/examples/cpp03/http/server/header.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// -// header.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_HEADER_HPP -#define HTTP_HEADER_HPP - -#include - -namespace http { -namespace server { - -struct header -{ - std::string name; - std::string value; -}; - -} // namespace server -} // namespace http - -#endif // HTTP_HEADER_HPP diff --git a/asio/src/examples/cpp03/http/server/main.cpp b/asio/src/examples/cpp03/http/server/main.cpp deleted file mode 100644 index a649cb0351..0000000000 --- a/asio/src/examples/cpp03/http/server/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// main.cpp -// ~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include "server.hpp" - -int main(int argc, char* argv[]) -{ - try - { - // Check command line arguments. - if (argc != 4) - { - std::cerr << "Usage: http_server
\n"; - std::cerr << " For IPv4, try:\n"; - std::cerr << " receiver 0.0.0.0 80 .\n"; - std::cerr << " For IPv6, try:\n"; - std::cerr << " receiver 0::0 80 .\n"; - return 1; - } - - // Initialise the server. - http::server::server s(argv[1], argv[2], argv[3]); - - // Run the server until stopped. - s.run(); - } - catch (std::exception& e) - { - std::cerr << "exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/http/server/mime_types.cpp b/asio/src/examples/cpp03/http/server/mime_types.cpp deleted file mode 100644 index 745de030ab..0000000000 --- a/asio/src/examples/cpp03/http/server/mime_types.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// mime_types.cpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "mime_types.hpp" - -namespace http { -namespace server { -namespace mime_types { - -struct mapping -{ - const char* extension; - const char* mime_type; -} mappings[] = -{ - { "gif", "image/gif" }, - { "htm", "text/html" }, - { "html", "text/html" }, - { "jpg", "image/jpeg" }, - { "png", "image/png" }, - { 0, 0 } // Marks end of list. -}; - -std::string extension_to_type(const std::string& extension) -{ - for (mapping* m = mappings; m->extension; ++m) - { - if (m->extension == extension) - { - return m->mime_type; - } - } - - return "text/plain"; -} - -} // namespace mime_types -} // namespace server -} // namespace http diff --git a/asio/src/examples/cpp03/http/server/mime_types.hpp b/asio/src/examples/cpp03/http/server/mime_types.hpp deleted file mode 100644 index 49f1defd44..0000000000 --- a/asio/src/examples/cpp03/http/server/mime_types.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// mime_types.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_MIME_TYPES_HPP -#define HTTP_MIME_TYPES_HPP - -#include - -namespace http { -namespace server { -namespace mime_types { - -/// Convert a file extension into a MIME type. -std::string extension_to_type(const std::string& extension); - -} // namespace mime_types -} // namespace server -} // namespace http - -#endif // HTTP_MIME_TYPES_HPP diff --git a/asio/src/examples/cpp03/http/server/reply.cpp b/asio/src/examples/cpp03/http/server/reply.cpp deleted file mode 100644 index e57d43fdef..0000000000 --- a/asio/src/examples/cpp03/http/server/reply.cpp +++ /dev/null @@ -1,256 +0,0 @@ -// -// reply.cpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "reply.hpp" -#include -#include - -namespace http { -namespace server { - -namespace status_strings { - -const std::string ok = - "HTTP/1.0 200 OK\r\n"; -const std::string created = - "HTTP/1.0 201 Created\r\n"; -const std::string accepted = - "HTTP/1.0 202 Accepted\r\n"; -const std::string no_content = - "HTTP/1.0 204 No Content\r\n"; -const std::string multiple_choices = - "HTTP/1.0 300 Multiple Choices\r\n"; -const std::string moved_permanently = - "HTTP/1.0 301 Moved Permanently\r\n"; -const std::string moved_temporarily = - "HTTP/1.0 302 Moved Temporarily\r\n"; -const std::string not_modified = - "HTTP/1.0 304 Not Modified\r\n"; -const std::string bad_request = - "HTTP/1.0 400 Bad Request\r\n"; -const std::string unauthorized = - "HTTP/1.0 401 Unauthorized\r\n"; -const std::string forbidden = - "HTTP/1.0 403 Forbidden\r\n"; -const std::string not_found = - "HTTP/1.0 404 Not Found\r\n"; -const std::string internal_server_error = - "HTTP/1.0 500 Internal Server Error\r\n"; -const std::string not_implemented = - "HTTP/1.0 501 Not Implemented\r\n"; -const std::string bad_gateway = - "HTTP/1.0 502 Bad Gateway\r\n"; -const std::string service_unavailable = - "HTTP/1.0 503 Service Unavailable\r\n"; - -asio::const_buffer to_buffer(reply::status_type status) -{ - switch (status) - { - case reply::ok: - return asio::buffer(ok); - case reply::created: - return asio::buffer(created); - case reply::accepted: - return asio::buffer(accepted); - case reply::no_content: - return asio::buffer(no_content); - case reply::multiple_choices: - return asio::buffer(multiple_choices); - case reply::moved_permanently: - return asio::buffer(moved_permanently); - case reply::moved_temporarily: - return asio::buffer(moved_temporarily); - case reply::not_modified: - return asio::buffer(not_modified); - case reply::bad_request: - return asio::buffer(bad_request); - case reply::unauthorized: - return asio::buffer(unauthorized); - case reply::forbidden: - return asio::buffer(forbidden); - case reply::not_found: - return asio::buffer(not_found); - case reply::internal_server_error: - return asio::buffer(internal_server_error); - case reply::not_implemented: - return asio::buffer(not_implemented); - case reply::bad_gateway: - return asio::buffer(bad_gateway); - case reply::service_unavailable: - return asio::buffer(service_unavailable); - default: - return asio::buffer(internal_server_error); - } -} - -} // namespace status_strings - -namespace misc_strings { - -const char name_value_separator[] = { ':', ' ' }; -const char crlf[] = { '\r', '\n' }; - -} // namespace misc_strings - -std::vector reply::to_buffers() -{ - std::vector buffers; - buffers.push_back(status_strings::to_buffer(status)); - for (std::size_t i = 0; i < headers.size(); ++i) - { - header& h = headers[i]; - buffers.push_back(asio::buffer(h.name)); - buffers.push_back(asio::buffer(misc_strings::name_value_separator)); - buffers.push_back(asio::buffer(h.value)); - buffers.push_back(asio::buffer(misc_strings::crlf)); - } - buffers.push_back(asio::buffer(misc_strings::crlf)); - buffers.push_back(asio::buffer(content)); - return buffers; -} - -namespace stock_replies { - -const char ok[] = ""; -const char created[] = - "" - "Created" - "

201 Created

" - ""; -const char accepted[] = - "" - "Accepted" - "

202 Accepted

" - ""; -const char no_content[] = - "" - "No Content" - "

204 Content

" - ""; -const char multiple_choices[] = - "" - "Multiple Choices" - "

300 Multiple Choices

" - ""; -const char moved_permanently[] = - "" - "Moved Permanently" - "

301 Moved Permanently

" - ""; -const char moved_temporarily[] = - "" - "Moved Temporarily" - "

302 Moved Temporarily

" - ""; -const char not_modified[] = - "" - "Not Modified" - "

304 Not Modified

" - ""; -const char bad_request[] = - "" - "Bad Request" - "

400 Bad Request

" - ""; -const char unauthorized[] = - "" - "Unauthorized" - "

401 Unauthorized

" - ""; -const char forbidden[] = - "" - "Forbidden" - "

403 Forbidden

" - ""; -const char not_found[] = - "" - "Not Found" - "

404 Not Found

" - ""; -const char internal_server_error[] = - "" - "Internal Server Error" - "

500 Internal Server Error

" - ""; -const char not_implemented[] = - "" - "Not Implemented" - "

501 Not Implemented

" - ""; -const char bad_gateway[] = - "" - "Bad Gateway" - "

502 Bad Gateway

" - ""; -const char service_unavailable[] = - "" - "Service Unavailable" - "

503 Service Unavailable

" - ""; - -std::string to_string(reply::status_type status) -{ - switch (status) - { - case reply::ok: - return ok; - case reply::created: - return created; - case reply::accepted: - return accepted; - case reply::no_content: - return no_content; - case reply::multiple_choices: - return multiple_choices; - case reply::moved_permanently: - return moved_permanently; - case reply::moved_temporarily: - return moved_temporarily; - case reply::not_modified: - return not_modified; - case reply::bad_request: - return bad_request; - case reply::unauthorized: - return unauthorized; - case reply::forbidden: - return forbidden; - case reply::not_found: - return not_found; - case reply::internal_server_error: - return internal_server_error; - case reply::not_implemented: - return not_implemented; - case reply::bad_gateway: - return bad_gateway; - case reply::service_unavailable: - return service_unavailable; - default: - return internal_server_error; - } -} - -} // namespace stock_replies - -reply reply::stock_reply(reply::status_type status) -{ - reply rep; - rep.status = status; - rep.content = stock_replies::to_string(status); - rep.headers.resize(2); - rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); - rep.headers[1].name = "Content-Type"; - rep.headers[1].value = "text/html"; - return rep; -} - -} // namespace server -} // namespace http diff --git a/asio/src/examples/cpp03/http/server/reply.hpp b/asio/src/examples/cpp03/http/server/reply.hpp deleted file mode 100644 index 060a0fd014..0000000000 --- a/asio/src/examples/cpp03/http/server/reply.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// -// reply.hpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_REPLY_HPP -#define HTTP_REPLY_HPP - -#include -#include -#include -#include "header.hpp" - -namespace http { -namespace server { - -/// A reply to be sent to a client. -struct reply -{ - /// The status of the reply. - enum status_type - { - ok = 200, - created = 201, - accepted = 202, - no_content = 204, - multiple_choices = 300, - moved_permanently = 301, - moved_temporarily = 302, - not_modified = 304, - bad_request = 400, - unauthorized = 401, - forbidden = 403, - not_found = 404, - internal_server_error = 500, - not_implemented = 501, - bad_gateway = 502, - service_unavailable = 503 - } status; - - /// The headers to be included in the reply. - std::vector
headers; - - /// The content to be sent in the reply. - std::string content; - - /// Convert the reply into a vector of buffers. The buffers do not own the - /// underlying memory blocks, therefore the reply object must remain valid and - /// not be changed until the write operation has completed. - std::vector to_buffers(); - - /// Get a stock reply. - static reply stock_reply(status_type status); -}; - -} // namespace server -} // namespace http - -#endif // HTTP_REPLY_HPP diff --git a/asio/src/examples/cpp03/http/server/server.cpp b/asio/src/examples/cpp03/http/server/server.cpp deleted file mode 100644 index 4c572f121e..0000000000 --- a/asio/src/examples/cpp03/http/server/server.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// server.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "server.hpp" -#include -#include - -namespace http { -namespace server { - -server::server(const std::string& address, const std::string& port, - const std::string& doc_root) - : io_context_(), - signals_(io_context_), - acceptor_(io_context_), - connection_manager_(), - new_connection_(), - request_handler_(doc_root) -{ - // Register to handle the signals that indicate when the server should exit. - // It is safe to register for the same signal multiple times in a program, - // provided all registration for the specified signal is made through Asio. - signals_.add(SIGINT); - signals_.add(SIGTERM); -#if defined(SIGQUIT) - signals_.add(SIGQUIT); -#endif // defined(SIGQUIT) - signals_.async_wait(boost::bind(&server::handle_stop, this)); - - // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR). - asio::ip::tcp::resolver resolver(io_context_); - asio::ip::tcp::endpoint endpoint = - *resolver.resolve(address, port).begin(); - acceptor_.open(endpoint.protocol()); - acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(true)); - acceptor_.bind(endpoint); - acceptor_.listen(); - - start_accept(); -} - -void server::run() -{ - // The io_context::run() call will block until all asynchronous operations - // have finished. While the server is running, there is always at least one - // asynchronous operation outstanding: the asynchronous accept call waiting - // for new incoming connections. - io_context_.run(); -} - -void server::start_accept() -{ - new_connection_.reset(new connection(io_context_, - connection_manager_, request_handler_)); - acceptor_.async_accept(new_connection_->socket(), - boost::bind(&server::handle_accept, this, - asio::placeholders::error)); -} - -void server::handle_accept(const asio::error_code& e) -{ - // Check whether the server was stopped by a signal before this completion - // handler had a chance to run. - if (!acceptor_.is_open()) - { - return; - } - - if (!e) - { - connection_manager_.start(new_connection_); - } - - start_accept(); -} - -void server::handle_stop() -{ - // The server is stopped by cancelling all outstanding asynchronous - // operations. Once all operations have finished the io_context::run() call - // will exit. - acceptor_.close(); - connection_manager_.stop_all(); -} - -} // namespace server -} // namespace http diff --git a/asio/src/examples/cpp03/http/server/server.hpp b/asio/src/examples/cpp03/http/server/server.hpp deleted file mode 100644 index fcd689c57c..0000000000 --- a/asio/src/examples/cpp03/http/server/server.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// server.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_SERVER_HPP -#define HTTP_SERVER_HPP - -#include -#include -#include -#include "connection.hpp" -#include "connection_manager.hpp" -#include "request_handler.hpp" - -namespace http { -namespace server { - -/// The top-level class of the HTTP server. -class server - : private boost::noncopyable -{ -public: - /// Construct the server to listen on the specified TCP address and port, and - /// serve up files from the given directory. - explicit server(const std::string& address, const std::string& port, - const std::string& doc_root); - - /// Run the server's io_context loop. - void run(); - -private: - /// Initiate an asynchronous accept operation. - void start_accept(); - - /// Handle completion of an asynchronous accept operation. - void handle_accept(const asio::error_code& e); - - /// Handle a request to stop the server. - void handle_stop(); - - /// The io_context used to perform asynchronous operations. - asio::io_context io_context_; - - /// The signal_set is used to register for process termination notifications. - asio::signal_set signals_; - - /// Acceptor used to listen for incoming connections. - asio::ip::tcp::acceptor acceptor_; - - /// The connection manager which owns all live connections. - connection_manager connection_manager_; - - /// The next connection to be accepted. - connection_ptr new_connection_; - - /// The handler for all incoming requests. - request_handler request_handler_; -}; - -} // namespace server -} // namespace http - -#endif // HTTP_SERVER_HPP diff --git a/asio/src/examples/cpp03/http/server2/.gitignore b/asio/src/examples/cpp03/http/server2/.gitignore deleted file mode 100644 index 0882fa6ced..0000000000 --- a/asio/src/examples/cpp03/http/server2/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*_server -*_client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/http/server2/connection.cpp b/asio/src/examples/cpp03/http/server2/connection.cpp deleted file mode 100644 index f6a5e0396c..0000000000 --- a/asio/src/examples/cpp03/http/server2/connection.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// -// connection.cpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "connection.hpp" -#include -#include -#include "request_handler.hpp" - -namespace http { -namespace server2 { - -connection::connection(asio::io_context& io_context, - request_handler& handler) - : socket_(io_context), - request_handler_(handler) -{ -} - -asio::ip::tcp::socket& connection::socket() -{ - return socket_; -} - -void connection::start() -{ - socket_.async_read_some(asio::buffer(buffer_), - boost::bind(&connection::handle_read, shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); -} - -void connection::handle_read(const asio::error_code& e, - std::size_t bytes_transferred) -{ - if (!e) - { - boost::tribool result; - boost::tie(result, boost::tuples::ignore) = request_parser_.parse( - request_, buffer_.data(), buffer_.data() + bytes_transferred); - - if (result) - { - request_handler_.handle_request(request_, reply_); - asio::async_write(socket_, reply_.to_buffers(), - boost::bind(&connection::handle_write, shared_from_this(), - asio::placeholders::error)); - } - else if (!result) - { - reply_ = reply::stock_reply(reply::bad_request); - asio::async_write(socket_, reply_.to_buffers(), - boost::bind(&connection::handle_write, shared_from_this(), - asio::placeholders::error)); - } - else - { - socket_.async_read_some(asio::buffer(buffer_), - boost::bind(&connection::handle_read, shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - - // If an error occurs then no new asynchronous operations are started. This - // means that all shared_ptr references to the connection object will - // disappear and the object will be destroyed automatically after this - // handler returns. The connection class's destructor closes the socket. -} - -void connection::handle_write(const asio::error_code& e) -{ - if (!e) - { - // Initiate graceful connection closure. - asio::error_code ignored_ec; - socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); - } - - // No new asynchronous operations are started. This means that all shared_ptr - // references to the connection object will disappear and the object will be - // destroyed automatically after this handler returns. The connection class's - // destructor closes the socket. -} - -} // namespace server2 -} // namespace http diff --git a/asio/src/examples/cpp03/http/server3/.gitignore b/asio/src/examples/cpp03/http/server3/.gitignore deleted file mode 100644 index 0882fa6ced..0000000000 --- a/asio/src/examples/cpp03/http/server3/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*_server -*_client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/http/server3/connection.cpp b/asio/src/examples/cpp03/http/server3/connection.cpp deleted file mode 100644 index e8fced9dc3..0000000000 --- a/asio/src/examples/cpp03/http/server3/connection.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// connection.cpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "connection.hpp" -#include -#include -#include "request_handler.hpp" - -namespace http { -namespace server3 { - -connection::connection(asio::io_context& io_context, - request_handler& handler) - : strand_(asio::make_strand(io_context)), - socket_(strand_), - request_handler_(handler) -{ -} - -asio::ip::tcp::socket& connection::socket() -{ - return socket_; -} - -void connection::start() -{ - socket_.async_read_some(asio::buffer(buffer_), - boost::bind(&connection::handle_read, shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); -} - -void connection::handle_read(const asio::error_code& e, - std::size_t bytes_transferred) -{ - if (!e) - { - boost::tribool result; - boost::tie(result, boost::tuples::ignore) = request_parser_.parse( - request_, buffer_.data(), buffer_.data() + bytes_transferred); - - if (result) - { - request_handler_.handle_request(request_, reply_); - asio::async_write(socket_, reply_.to_buffers(), - boost::bind(&connection::handle_write, shared_from_this(), - asio::placeholders::error)); - } - else if (!result) - { - reply_ = reply::stock_reply(reply::bad_request); - asio::async_write(socket_, reply_.to_buffers(), - boost::bind(&connection::handle_write, shared_from_this(), - asio::placeholders::error)); - } - else - { - socket_.async_read_some(asio::buffer(buffer_), - boost::bind(&connection::handle_read, shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - - // If an error occurs then no new asynchronous operations are started. This - // means that all shared_ptr references to the connection object will - // disappear and the object will be destroyed automatically after this - // handler returns. The connection class's destructor closes the socket. -} - -void connection::handle_write(const asio::error_code& e) -{ - if (!e) - { - // Initiate graceful connection closure. - asio::error_code ignored_ec; - socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); - } - - // No new asynchronous operations are started. This means that all shared_ptr - // references to the connection object will disappear and the object will be - // destroyed automatically after this handler returns. The connection class's - // destructor closes the socket. -} - -} // namespace server3 -} // namespace http diff --git a/asio/src/examples/cpp03/http/server4/.gitignore b/asio/src/examples/cpp03/http/server4/.gitignore deleted file mode 100644 index 0882fa6ced..0000000000 --- a/asio/src/examples/cpp03/http/server4/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*_server -*_client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/http/server4/request.hpp b/asio/src/examples/cpp03/http/server4/request.hpp deleted file mode 100644 index 8e00525d94..0000000000 --- a/asio/src/examples/cpp03/http/server4/request.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// request.hpp -// ~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_SERVER4_REQUEST_HPP -#define HTTP_SERVER4_REQUEST_HPP - -#include -#include -#include "header.hpp" - -namespace http { -namespace server4 { - -/// A request received from a client. -struct request -{ - /// The request method, e.g. "GET", "POST". - std::string method; - - /// The requested URI, such as a path to a file. - std::string uri; - - /// Major version number, usually 1. - int http_version_major; - - /// Minor version number, usually 0 or 1. - int http_version_minor; - - /// The headers included with the request. - std::vector
headers; - - /// The optional content sent with the request. - std::string content; -}; - -} // namespace server4 -} // namespace http - -#endif // HTTP_SERVER4_REQUEST_HPP diff --git a/asio/src/examples/cpp03/http/server4/request_parser.cpp b/asio/src/examples/cpp03/http/server4/request_parser.cpp deleted file mode 100644 index 37ac005e24..0000000000 --- a/asio/src/examples/cpp03/http/server4/request_parser.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// -// request_parser.cpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "request_parser.hpp" -#include -#include -#include -#include "request.hpp" - -namespace http { -namespace server4 { - -// Enable the pseudo-keywords reenter, yield and fork. -#include - -std::string request_parser::content_length_name_ = "Content-Length"; - -boost::tribool request_parser::consume(request& req, char c) -{ - reenter (this) - { - req.method.clear(); - req.uri.clear(); - req.http_version_major = 0; - req.http_version_minor = 0; - req.headers.clear(); - req.content.clear(); - content_length_ = 0; - - // Request method. - while (is_char(c) && !is_ctl(c) && !is_tspecial(c) && c != ' ') - { - req.method.push_back(c); - yield return boost::indeterminate; - } - if (req.method.empty()) - return false; - - // Space. - if (c != ' ') return false; - yield return boost::indeterminate; - - // URI. - while (!is_ctl(c) && c != ' ') - { - req.uri.push_back(c); - yield return boost::indeterminate; - } - if (req.uri.empty()) return false; - - // Space. - if (c != ' ') return false; - yield return boost::indeterminate; - - // HTTP protocol identifier. - if (c != 'H') return false; - yield return boost::indeterminate; - if (c != 'T') return false; - yield return boost::indeterminate; - if (c != 'T') return false; - yield return boost::indeterminate; - if (c != 'P') return false; - yield return boost::indeterminate; - - // Slash. - if (c != '/') return false; - yield return boost::indeterminate; - - // Major version number. - if (!is_digit(c)) return false; - while (is_digit(c)) - { - req.http_version_major = req.http_version_major * 10 + c - '0'; - yield return boost::indeterminate; - } - - // Dot. - if (c != '.') return false; - yield return boost::indeterminate; - - // Minor version number. - if (!is_digit(c)) return false; - while (is_digit(c)) - { - req.http_version_minor = req.http_version_minor * 10 + c - '0'; - yield return boost::indeterminate; - } - - // CRLF. - if (c != '\r') return false; - yield return boost::indeterminate; - if (c != '\n') return false; - yield return boost::indeterminate; - - // Headers. - while ((is_char(c) && !is_ctl(c) && !is_tspecial(c) && c != '\r') - || (c == ' ' || c == '\t')) - { - if (c == ' ' || c == '\t') - { - // Leading whitespace. Must be continuation of previous header's value. - if (req.headers.empty()) return false; - while (c == ' ' || c == '\t') - yield return boost::indeterminate; - } - else - { - // Start the next header. - req.headers.push_back(header()); - - // Header name. - while (is_char(c) && !is_ctl(c) && !is_tspecial(c) && c != ':') - { - req.headers.back().name.push_back(c); - yield return boost::indeterminate; - } - - // Colon and space separates the header name from the header value. - if (c != ':') return false; - yield return boost::indeterminate; - if (c != ' ') return false; - yield return boost::indeterminate; - } - - // Header value. - while (is_char(c) && !is_ctl(c) && c != '\r') - { - req.headers.back().value.push_back(c); - yield return boost::indeterminate; - } - - // CRLF. - if (c != '\r') return false; - yield return boost::indeterminate; - if (c != '\n') return false; - yield return boost::indeterminate; - } - - // CRLF. - if (c != '\r') return false; - yield return boost::indeterminate; - if (c != '\n') return false; - - // Check for optional Content-Length header. - for (std::size_t i = 0; i < req.headers.size(); ++i) - { - if (headers_equal(req.headers[i].name, content_length_name_)) - { - try - { - content_length_ = - boost::lexical_cast(req.headers[i].value); - } - catch (boost::bad_lexical_cast&) - { - return false; - } - } - } - - // Content. - while (req.content.size() < content_length_) - { - yield return boost::indeterminate; - req.content.push_back(c); - } - } - - return true; -} - -// Disable the pseudo-keywords reenter, yield and fork. -#include - -bool request_parser::is_char(int c) -{ - return c >= 0 && c <= 127; -} - -bool request_parser::is_ctl(int c) -{ - return (c >= 0 && c <= 31) || (c == 127); -} - -bool request_parser::is_tspecial(int c) -{ - switch (c) - { - case '(': case ')': case '<': case '>': case '@': - case ',': case ';': case ':': case '\\': case '"': - case '/': case '[': case ']': case '?': case '=': - case '{': case '}': case ' ': case '\t': - return true; - default: - return false; - } -} - -bool request_parser::is_digit(int c) -{ - return c >= '0' && c <= '9'; -} - -bool request_parser::tolower_compare(char a, char b) -{ - return std::tolower(a) == std::tolower(b); -} - -bool request_parser::headers_equal(const std::string& a, const std::string& b) -{ - if (a.length() != b.length()) - return false; - - return std::equal(a.begin(), a.end(), b.begin(), - &request_parser::tolower_compare); -} - -} // namespace server4 -} // namespace http diff --git a/asio/src/examples/cpp03/http/server4/request_parser.hpp b/asio/src/examples/cpp03/http/server4/request_parser.hpp deleted file mode 100644 index 7c8b4bca81..0000000000 --- a/asio/src/examples/cpp03/http/server4/request_parser.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// request_parser.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef HTTP_SERVER4_REQUEST_PARSER_HPP -#define HTTP_SERVER4_REQUEST_PARSER_HPP - -#include -#include -#include -#include - -namespace http { -namespace server4 { - -struct request; - -/// Parser for incoming requests. -class request_parser : asio::coroutine -{ -public: - /// Parse some data. The tribool return value is true when a complete request - /// has been parsed, false if the data is invalid, indeterminate when more - /// data is required. The InputIterator return value indicates how much of the - /// input has been consumed. - template - boost::tuple parse(request& req, - InputIterator begin, InputIterator end) - { - while (begin != end) - { - boost::tribool result = consume(req, *begin++); - if (result || !result) - return boost::make_tuple(result, begin); - } - boost::tribool result = boost::indeterminate; - return boost::make_tuple(result, begin); - } - -private: - /// The name of the content length header. - static std::string content_length_name_; - - /// Content length as decoded from headers. Defaults to 0. - std::size_t content_length_; - - /// Handle the next character of input. - boost::tribool consume(request& req, char input); - - /// Check if a byte is an HTTP character. - static bool is_char(int c); - - /// Check if a byte is an HTTP control character. - static bool is_ctl(int c); - - /// Check if a byte is defined as an HTTP tspecial character. - static bool is_tspecial(int c); - - /// Check if a byte is a digit. - static bool is_digit(int c); - - /// Check if two characters are equal, without regard to case. - static bool tolower_compare(char a, char b); - - /// Check whether the two request header names match. - bool headers_equal(const std::string& a, const std::string& b); -}; - -} // namespace server4 -} // namespace http - -#endif // HTTP_SERVER4_REQUEST_PARSER_HPP diff --git a/asio/src/examples/cpp03/invocation/.gitignore b/asio/src/examples/cpp03/invocation/.gitignore deleted file mode 100644 index e5876b7811..0000000000 --- a/asio/src/examples/cpp03/invocation/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -prioritised_handlers -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp b/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp deleted file mode 100644 index 5caf587e06..0000000000 --- a/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp +++ /dev/null @@ -1,171 +0,0 @@ -// -// prioritised_handlers.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "asio.hpp" -#include -#include -#include - -using asio::ip::tcp; - -class handler_priority_queue : public asio::execution_context -{ -public: - void add(int priority, boost::function function) - { - handlers_.push(queued_handler(priority, function)); - } - - void execute_all() - { - while (!handlers_.empty()) - { - queued_handler handler = handlers_.top(); - handler.execute(); - handlers_.pop(); - } - } - - class executor - { - public: - executor(handler_priority_queue& q, int p) - : context_(q), priority_(p) - { - } - - handler_priority_queue& context() const - { - return context_; - } - - template - void dispatch(const Function& f, const Allocator&) const - { - context_.add(priority_, f); - } - - template - void post(const Function& f, const Allocator&) const - { - context_.add(priority_, f); - } - - template - void defer(const Function& f, const Allocator&) const - { - context_.add(priority_, f); - } - - void on_work_started() const {} - void on_work_finished() const {} - - bool operator==(const executor& other) const - { - return &context_ == &other.context_ && priority_ == other.priority_; - } - - bool operator!=(const executor& other) const - { - return !operator==(other); - } - - private: - handler_priority_queue& context_; - int priority_; - }; - - template - asio::executor_binder - wrap(int priority, Handler handler) - { - return asio::bind_executor(executor(*this, priority), handler); - } - -private: - class queued_handler - { - public: - queued_handler(int p, boost::function f) - : priority_(p), function_(f) - { - } - - void execute() - { - function_(); - } - - friend bool operator<(const queued_handler& a, - const queued_handler& b) - { - return a.priority_ < b.priority_; - } - - private: - int priority_; - boost::function function_; - }; - - std::priority_queue handlers_; -}; - -//---------------------------------------------------------------------- - -void high_priority_handler(const asio::error_code& /*ec*/) -{ - std::cout << "High priority handler\n"; -} - -void middle_priority_handler(const asio::error_code& /*ec*/) -{ - std::cout << "Middle priority handler\n"; -} - -void low_priority_handler() -{ - std::cout << "Low priority handler\n"; -} - -int main() -{ - asio::io_context io_context; - - handler_priority_queue pri_queue; - - // Post a completion handler to be run immediately. - asio::post(io_context, pri_queue.wrap(0, low_priority_handler)); - - // Start an asynchronous accept that will complete immediately. - tcp::endpoint endpoint(asio::ip::address_v4::loopback(), 0); - tcp::acceptor acceptor(io_context, endpoint); - tcp::socket server_socket(io_context); - acceptor.async_accept(server_socket, - pri_queue.wrap(100, high_priority_handler)); - tcp::socket client_socket(io_context); - client_socket.connect(acceptor.local_endpoint()); - - // Set a deadline timer to expire immediately. - asio::steady_timer timer(io_context); - timer.expires_at(asio::steady_timer::time_point::min()); - timer.async_wait(pri_queue.wrap(42, middle_priority_handler)); - - while (io_context.run_one()) - { - // The custom invocation hook adds the handlers to the priority queue - // rather than executing them from within the poll_one() call. - while (io_context.poll_one()) - ; - - pri_queue.execute_all(); - } - - return 0; -} diff --git a/asio/src/examples/cpp03/iostreams/.gitignore b/asio/src/examples/cpp03/iostreams/.gitignore deleted file mode 100644 index bc2b4f8f7f..0000000000 --- a/asio/src/examples/cpp03/iostreams/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*_client -*_server -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/iostreams/http_client.cpp b/asio/src/examples/cpp03/iostreams/http_client.cpp deleted file mode 100644 index 3e6e24e830..0000000000 --- a/asio/src/examples/cpp03/iostreams/http_client.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// -// http_client.cpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include - -using asio::ip::tcp; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cout << "Usage: http_client \n"; - std::cout << "Example:\n"; - std::cout << " http_client www.boost.org /LICENSE_1_0.txt\n"; - return 1; - } - - asio::ip::tcp::iostream s; - - // The entire sequence of I/O operations must complete within 60 seconds. - // If an expiry occurs, the socket is automatically closed and the stream - // becomes bad. - s.expires_after(asio::chrono::seconds(60)); - - // Establish a connection to the server. - s.connect(argv[1], "http"); - if (!s) - { - std::cout << "Unable to connect: " << s.error().message() << "\n"; - return 1; - } - - // Send the request. We specify the "Connection: close" header so that the - // server will close the socket after transmitting the response. This will - // allow us to treat all data up until the EOF as the content. - s << "GET " << argv[2] << " HTTP/1.0\r\n"; - s << "Host: " << argv[1] << "\r\n"; - s << "Accept: */*\r\n"; - s << "Connection: close\r\n\r\n"; - - // By default, the stream is tied with itself. This means that the stream - // automatically flush the buffered output before attempting a read. It is - // not necessary not explicitly flush the stream at this point. - - // Check that response is OK. - std::string http_version; - s >> http_version; - unsigned int status_code; - s >> status_code; - std::string status_message; - std::getline(s, status_message); - if (!s || http_version.substr(0, 5) != "HTTP/") - { - std::cout << "Invalid response\n"; - return 1; - } - if (status_code != 200) - { - std::cout << "Response returned with status code " << status_code << "\n"; - return 1; - } - - // Process the response headers, which are terminated by a blank line. - std::string header; - while (std::getline(s, header) && header != "\r") - std::cout << header << "\n"; - std::cout << "\n"; - - // Write the remaining data to output. - std::cout << s.rdbuf(); - } - catch (std::exception& e) - { - std::cout << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/local/.gitignore b/asio/src/examples/cpp03/local/.gitignore deleted file mode 100644 index 688277b48d..0000000000 --- a/asio/src/examples/cpp03/local/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -connect_pair -stream_server -stream_client -iostream_client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/local/connect_pair.cpp b/asio/src/examples/cpp03/local/connect_pair.cpp deleted file mode 100644 index 53cc0d5248..0000000000 --- a/asio/src/examples/cpp03/local/connect_pair.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// -// connect_pair.cpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include - -#if defined(ASIO_HAS_LOCAL_SOCKETS) - -using asio::local::stream_protocol; - -class uppercase_filter -{ -public: - uppercase_filter(asio::io_context& io_context) - : socket_(io_context) - { - } - - stream_protocol::socket& socket() - { - return socket_; - } - - void start() - { - // Wait for request. - socket_.async_read_some(asio::buffer(data_), - boost::bind(&uppercase_filter::handle_read, - this, asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - -private: - void handle_read(const asio::error_code& ec, std::size_t size) - { - if (!ec) - { - // Compute result. - for (std::size_t i = 0; i < size; ++i) - data_[i] = std::toupper(data_[i]); - - // Send result. - asio::async_write(socket_, asio::buffer(data_, size), - boost::bind(&uppercase_filter::handle_write, - this, asio::placeholders::error)); - } - else - { - throw asio::system_error(ec); - } - } - - void handle_write(const asio::error_code& ec) - { - if (!ec) - { - // Wait for request. - socket_.async_read_some(asio::buffer(data_), - boost::bind(&uppercase_filter::handle_read, - this, asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - throw asio::system_error(ec); - } - } - - stream_protocol::socket socket_; - boost::array data_; -}; - -void run(asio::io_context* io_context) -{ - try - { - io_context->run(); - } - catch (std::exception& e) - { - std::cerr << "Exception in thread: " << e.what() << "\n"; - std::exit(1); - } -} - -int main() -{ - try - { - asio::io_context io_context; - - // Create filter and establish a connection to it. - uppercase_filter filter(io_context); - stream_protocol::socket socket(io_context); - asio::local::connect_pair(socket, filter.socket()); - filter.start(); - - // The io_context runs in a background thread to perform filtering. - asio::thread thread(boost::bind(run, &io_context)); - - for (;;) - { - // Collect request from user. - std::cout << "Enter a string: "; - std::string request; - std::getline(std::cin, request); - - // Send request to filter. - asio::write(socket, asio::buffer(request)); - - // Wait for reply from filter. - std::vector reply(request.size()); - asio::read(socket, asio::buffer(reply)); - - // Show reply to user. - std::cout << "Result: "; - std::cout.write(&reply[0], request.size()); - std::cout << std::endl; - } - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - std::exit(1); - } -} - -#else // defined(ASIO_HAS_LOCAL_SOCKETS) -# error Local sockets not available on this platform. -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) diff --git a/asio/src/examples/cpp03/local/iostream_client.cpp b/asio/src/examples/cpp03/local/iostream_client.cpp deleted file mode 100644 index 0ebaa23d8c..0000000000 --- a/asio/src/examples/cpp03/local/iostream_client.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// stream_client.cpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include "asio.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) - -using asio::local::stream_protocol; - -enum { max_length = 1024 }; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: iostream_client \n"; - return 1; - } - - stream_protocol::endpoint ep(argv[1]); - stream_protocol::iostream s(ep); - if (!s) - { - std::cerr << "Unable to connect: " << s.error().message() << std::endl; - return 1; - } - - using namespace std; // For strlen. - std::cout << "Enter message: "; - char request[max_length]; - std::cin.getline(request, max_length); - size_t length = strlen(request); - s << request; - - char reply[max_length]; - s.read(reply, length); - std::cout << "Reply is: "; - std::cout.write(reply, length); - std::cout << "\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} - -#else // defined(ASIO_HAS_LOCAL_SOCKETS) -# error Local sockets not available on this platform. -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) diff --git a/asio/src/examples/cpp03/local/stream_client.cpp b/asio/src/examples/cpp03/local/stream_client.cpp deleted file mode 100644 index 80674a4798..0000000000 --- a/asio/src/examples/cpp03/local/stream_client.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -// stream_client.cpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) - -using asio::local::stream_protocol; - -enum { max_length = 1024 }; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: stream_client \n"; - return 1; - } - - asio::io_context io_context; - - stream_protocol::socket s(io_context); - s.connect(stream_protocol::endpoint(argv[1])); - - using namespace std; // For strlen. - std::cout << "Enter message: "; - char request[max_length]; - std::cin.getline(request, max_length); - size_t request_length = strlen(request); - asio::write(s, asio::buffer(request, request_length)); - - char reply[max_length]; - size_t reply_length = asio::read(s, - asio::buffer(reply, request_length)); - std::cout << "Reply is: "; - std::cout.write(reply, reply_length); - std::cout << "\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} - -#else // defined(ASIO_HAS_LOCAL_SOCKETS) -# error Local sockets not available on this platform. -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) diff --git a/asio/src/examples/cpp03/local/stream_server.cpp b/asio/src/examples/cpp03/local/stream_server.cpp deleted file mode 100644 index f54d5a054d..0000000000 --- a/asio/src/examples/cpp03/local/stream_server.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// -// stream_server.cpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include "asio.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) - -using asio::local::stream_protocol; - -class session - : public boost::enable_shared_from_this -{ -public: - session(asio::io_context& io_context) - : socket_(io_context) - { - } - - stream_protocol::socket& socket() - { - return socket_; - } - - void start() - { - socket_.async_read_some(asio::buffer(data_), - boost::bind(&session::handle_read, - shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - - void handle_read(const asio::error_code& error, - size_t bytes_transferred) - { - if (!error) - { - asio::async_write(socket_, - asio::buffer(data_, bytes_transferred), - boost::bind(&session::handle_write, - shared_from_this(), - asio::placeholders::error)); - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - socket_.async_read_some(asio::buffer(data_), - boost::bind(&session::handle_read, - shared_from_this(), - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - -private: - // The socket used to communicate with the client. - stream_protocol::socket socket_; - - // Buffer used to store data received from the client. - boost::array data_; -}; - -typedef boost::shared_ptr session_ptr; - -class server -{ -public: - server(asio::io_context& io_context, const std::string& file) - : io_context_(io_context), - acceptor_(io_context, stream_protocol::endpoint(file)) - { - session_ptr new_session(new session(io_context_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - - void handle_accept(session_ptr new_session, - const asio::error_code& error) - { - if (!error) - { - new_session->start(); - } - - new_session.reset(new session(io_context_)); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - -private: - asio::io_context& io_context_; - stream_protocol::acceptor acceptor_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: stream_server \n"; - std::cerr << "*** WARNING: existing file is removed ***\n"; - return 1; - } - - asio::io_context io_context; - - std::remove(argv[1]); - server s(io_context, argv[1]); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} - -#else // defined(ASIO_HAS_LOCAL_SOCKETS) -# error Local sockets not available on this platform. -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) diff --git a/asio/src/examples/cpp03/multicast/.gitignore b/asio/src/examples/cpp03/multicast/.gitignore deleted file mode 100644 index 0c30ebdd7d..0000000000 --- a/asio/src/examples/cpp03/multicast/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -receiver -sender -*.o -*.obj -*.exe -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/multicast/receiver.cpp b/asio/src/examples/cpp03/multicast/receiver.cpp deleted file mode 100644 index b06bdd7789..0000000000 --- a/asio/src/examples/cpp03/multicast/receiver.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// -// receiver.cpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include "asio.hpp" -#include "boost/bind/bind.hpp" - -const short multicast_port = 30001; - -class receiver -{ -public: - receiver(asio::io_context& io_context, - const asio::ip::address& listen_address, - const asio::ip::address& multicast_address) - : socket_(io_context) - { - // Create the socket so that multiple may be bound to the same address. - asio::ip::udp::endpoint listen_endpoint( - listen_address, multicast_port); - socket_.open(listen_endpoint.protocol()); - socket_.set_option(asio::ip::udp::socket::reuse_address(true)); - socket_.bind(listen_endpoint); - - // Join the multicast group. - socket_.set_option( - asio::ip::multicast::join_group(multicast_address)); - - socket_.async_receive_from( - asio::buffer(data_, max_length), sender_endpoint_, - boost::bind(&receiver::handle_receive_from, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - - void handle_receive_from(const asio::error_code& error, - size_t bytes_recvd) - { - if (!error) - { - std::cout.write(data_, bytes_recvd); - std::cout << std::endl; - - socket_.async_receive_from( - asio::buffer(data_, max_length), sender_endpoint_, - boost::bind(&receiver::handle_receive_from, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - } - -private: - asio::ip::udp::socket socket_; - asio::ip::udp::endpoint sender_endpoint_; - enum { max_length = 1024 }; - char data_[max_length]; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: receiver \n"; - std::cerr << " For IPv4, try:\n"; - std::cerr << " receiver 0.0.0.0 239.255.0.1\n"; - std::cerr << " For IPv6, try:\n"; - std::cerr << " receiver 0::0 ff31::8000:1234\n"; - return 1; - } - - asio::io_context io_context; - receiver r(io_context, - asio::ip::make_address(argv[1]), - asio::ip::make_address(argv[2])); - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/multicast/sender.cpp b/asio/src/examples/cpp03/multicast/sender.cpp deleted file mode 100644 index 3006b0b22d..0000000000 --- a/asio/src/examples/cpp03/multicast/sender.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// sender.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" -#include "boost/bind/bind.hpp" - -const short multicast_port = 30001; -const int max_message_count = 10; - -class sender -{ -public: - sender(asio::io_context& io_context, - const asio::ip::address& multicast_address) - : endpoint_(multicast_address, multicast_port), - socket_(io_context, endpoint_.protocol()), - timer_(io_context), - message_count_(0) - { - std::ostringstream os; - os << "Message " << message_count_++; - message_ = os.str(); - - socket_.async_send_to( - asio::buffer(message_), endpoint_, - boost::bind(&sender::handle_send_to, this, - asio::placeholders::error)); - } - - void handle_send_to(const asio::error_code& error) - { - if (!error && message_count_ < max_message_count) - { - timer_.expires_after(asio::chrono::seconds(1)); - timer_.async_wait( - boost::bind(&sender::handle_timeout, this, - asio::placeholders::error)); - } - } - - void handle_timeout(const asio::error_code& error) - { - if (!error) - { - std::ostringstream os; - os << "Message " << message_count_++; - message_ = os.str(); - - socket_.async_send_to( - asio::buffer(message_), endpoint_, - boost::bind(&sender::handle_send_to, this, - asio::placeholders::error)); - } - } - -private: - asio::ip::udp::endpoint endpoint_; - asio::ip::udp::socket socket_; - asio::steady_timer timer_; - int message_count_; - std::string message_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: sender \n"; - std::cerr << " For IPv4, try:\n"; - std::cerr << " sender 239.255.0.1\n"; - std::cerr << " For IPv6, try:\n"; - std::cerr << " sender ff31::8000:1234\n"; - return 1; - } - - asio::io_context io_context; - sender s(io_context, asio::ip::make_address(argv[1])); - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/nonblocking/.gitignore b/asio/src/examples/cpp03/nonblocking/.gitignore deleted file mode 100644 index 760e0dcebb..0000000000 --- a/asio/src/examples/cpp03/nonblocking/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -third_party_lib -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp b/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp deleted file mode 100644 index 1766051a32..0000000000 --- a/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp +++ /dev/null @@ -1,240 +0,0 @@ -// -// third_party_lib.cpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include - -using asio::ip::tcp; - -namespace third_party_lib { - -// Simulation of a third party library that wants to perform read and write -// operations directly on a socket. It needs to be polled to determine whether -// it requires a read or write operation, and notified when the socket is ready -// for reading or writing. -class session -{ -public: - session(tcp::socket& socket) - : socket_(socket), - state_(reading) - { - } - - // Returns true if the third party library wants to be notified when the - // socket is ready for reading. - bool want_read() const - { - return state_ == reading; - } - - // Notify that third party library that it should perform its read operation. - void do_read(asio::error_code& ec) - { - if (std::size_t len = socket_.read_some(asio::buffer(data_), ec)) - { - write_buffer_ = asio::buffer(data_, len); - state_ = writing; - } - } - - // Returns true if the third party library wants to be notified when the - // socket is ready for writing. - bool want_write() const - { - return state_ == writing; - } - - // Notify that third party library that it should perform its write operation. - void do_write(asio::error_code& ec) - { - if (std::size_t len = socket_.write_some( - asio::buffer(write_buffer_), ec)) - { - write_buffer_ = write_buffer_ + len; - state_ = asio::buffer_size(write_buffer_) > 0 ? writing : reading; - } - } - -private: - tcp::socket& socket_; - enum { reading, writing } state_; - boost::array data_; - asio::const_buffer write_buffer_; -}; - -} // namespace third_party_lib - -// The glue between asio's sockets and the third party library. -class connection - : public boost::enable_shared_from_this -{ -public: - typedef boost::shared_ptr pointer; - - static pointer create(const asio::any_io_executor& ex) - { - return pointer(new connection(ex)); - } - - tcp::socket& socket() - { - return socket_; - } - - void start() - { - // Put the socket into non-blocking mode. - socket_.non_blocking(true); - - start_operations(); - } - -private: - connection(const asio::any_io_executor& ex) - : socket_(ex), - session_impl_(socket_), - read_in_progress_(false), - write_in_progress_(false) - { - } - - void start_operations() - { - // Start a read operation if the third party library wants one. - if (session_impl_.want_read() && !read_in_progress_) - { - read_in_progress_ = true; - socket_.async_wait(tcp::socket::wait_read, - boost::bind(&connection::handle_read, - shared_from_this(), - asio::placeholders::error)); - } - - // Start a write operation if the third party library wants one. - if (session_impl_.want_write() && !write_in_progress_) - { - write_in_progress_ = true; - socket_.async_wait(tcp::socket::wait_write, - boost::bind(&connection::handle_write, - shared_from_this(), - asio::placeholders::error)); - } - } - - void handle_read(asio::error_code ec) - { - read_in_progress_ = false; - - // Notify third party library that it can perform a read. - if (!ec) - session_impl_.do_read(ec); - - // The third party library successfully performed a read on the socket. - // Start new read or write operations based on what it now wants. - if (!ec || ec == asio::error::would_block) - start_operations(); - - // Otherwise, an error occurred. Closing the socket cancels any outstanding - // asynchronous read or write operations. The connection object will be - // destroyed automatically once those outstanding operations complete. - else - socket_.close(); - } - - void handle_write(asio::error_code ec) - { - write_in_progress_ = false; - - // Notify third party library that it can perform a write. - if (!ec) - session_impl_.do_write(ec); - - // The third party library successfully performed a write on the socket. - // Start new read or write operations based on what it now wants. - if (!ec || ec == asio::error::would_block) - start_operations(); - - // Otherwise, an error occurred. Closing the socket cancels any outstanding - // asynchronous read or write operations. The connection object will be - // destroyed automatically once those outstanding operations complete. - else - socket_.close(); - } - -private: - tcp::socket socket_; - third_party_lib::session session_impl_; - bool read_in_progress_; - bool write_in_progress_; -}; - -class server -{ -public: - server(asio::io_context& io_context, unsigned short port) - : acceptor_(io_context, tcp::endpoint(tcp::v4(), port)) - { - start_accept(); - } - -private: - void start_accept() - { - connection::pointer new_connection = - connection::create(acceptor_.get_executor()); - - acceptor_.async_accept(new_connection->socket(), - boost::bind(&server::handle_accept, this, new_connection, - asio::placeholders::error)); - } - - void handle_accept(connection::pointer new_connection, - const asio::error_code& error) - { - if (!error) - { - new_connection->start(); - } - - start_accept(); - } - - tcp::acceptor acceptor_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: third_party_lib \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/socks4/.gitignore b/asio/src/examples/cpp03/socks4/.gitignore deleted file mode 100644 index e11e0de344..0000000000 --- a/asio/src/examples/cpp03/socks4/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -sync_client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/socks4/socks4.hpp b/asio/src/examples/cpp03/socks4/socks4.hpp deleted file mode 100644 index 6e0c26761d..0000000000 --- a/asio/src/examples/cpp03/socks4/socks4.hpp +++ /dev/null @@ -1,144 +0,0 @@ -// -// socks4.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef SOCKS4_HPP -#define SOCKS4_HPP - -#include -#include -#include - -namespace socks4 { - -const unsigned char version = 0x04; - -class request -{ -public: - enum command_type - { - connect = 0x01, - bind = 0x02 - }; - - request(command_type cmd, const asio::ip::tcp::endpoint& endpoint, - const std::string& user_id) - : version_(version), - command_(cmd), - user_id_(user_id), - null_byte_(0) - { - // Only IPv4 is supported by the SOCKS 4 protocol. - if (endpoint.protocol() != asio::ip::tcp::v4()) - { - throw asio::system_error( - asio::error::address_family_not_supported); - } - - // Convert port number to network byte order. - unsigned short port = endpoint.port(); - port_high_byte_ = (port >> 8) & 0xff; - port_low_byte_ = port & 0xff; - - // Save IP address in network byte order. - address_ = endpoint.address().to_v4().to_bytes(); - } - - boost::array buffers() const - { - boost::array bufs = - { - { - asio::buffer(&version_, 1), - asio::buffer(&command_, 1), - asio::buffer(&port_high_byte_, 1), - asio::buffer(&port_low_byte_, 1), - asio::buffer(address_), - asio::buffer(user_id_), - asio::buffer(&null_byte_, 1) - } - }; - return bufs; - } - -private: - unsigned char version_; - unsigned char command_; - unsigned char port_high_byte_; - unsigned char port_low_byte_; - asio::ip::address_v4::bytes_type address_; - std::string user_id_; - unsigned char null_byte_; -}; - -class reply -{ -public: - enum status_type - { - request_granted = 0x5a, - request_failed = 0x5b, - request_failed_no_identd = 0x5c, - request_failed_bad_user_id = 0x5d - }; - - reply() - : null_byte_(0), - status_() - { - } - - boost::array buffers() - { - boost::array bufs = - { - { - asio::buffer(&null_byte_, 1), - asio::buffer(&status_, 1), - asio::buffer(&port_high_byte_, 1), - asio::buffer(&port_low_byte_, 1), - asio::buffer(address_) - } - }; - return bufs; - } - - bool success() const - { - return null_byte_ == 0 && status_ == request_granted; - } - - unsigned char status() const - { - return status_; - } - - asio::ip::tcp::endpoint endpoint() const - { - unsigned short port = port_high_byte_; - port = (port << 8) & 0xff00; - port = port | port_low_byte_; - - asio::ip::address_v4 address(address_); - - return asio::ip::tcp::endpoint(address, port); - } - -private: - unsigned char null_byte_; - unsigned char status_; - unsigned char port_high_byte_; - unsigned char port_low_byte_; - asio::ip::address_v4::bytes_type address_; -}; - -} // namespace socks4 - -#endif // SOCKS4_HPP diff --git a/asio/src/examples/cpp03/socks4/sync_client.cpp b/asio/src/examples/cpp03/socks4/sync_client.cpp deleted file mode 100644 index 41616284e5..0000000000 --- a/asio/src/examples/cpp03/socks4/sync_client.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// sync_client.cpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include "socks4.hpp" - -using asio::ip::tcp; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 4) - { - std::cout << "Usage: sync_client \n"; - std::cout << "Examples:\n"; - std::cout << " sync_client 127.0.0.1 1080 chris\n"; - std::cout << " sync_client localhost socks chris\n"; - return 1; - } - - asio::io_context io_context; - - // Get a list of endpoints corresponding to the SOCKS 4 server name. - tcp::resolver resolver(io_context); - tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]); - - // Try each endpoint until we successfully establish a connection to the - // SOCKS 4 server. - tcp::socket socket(io_context); - asio::connect(socket, endpoints); - - // Get an endpoint for the Boost website. This will be passed to the SOCKS - // 4 server. Explicitly specify IPv4 since SOCKS 4 does not support IPv6. - tcp::endpoint http_endpoint = - *resolver.resolve(tcp::v4(), "www.boost.org", "http").begin(); - - // Send the request to the SOCKS 4 server. - socks4::request socks_request( - socks4::request::connect, http_endpoint, argv[3]); - asio::write(socket, socks_request.buffers()); - - // Receive a response from the SOCKS 4 server. - socks4::reply socks_reply; - asio::read(socket, socks_reply.buffers()); - - // Check whether we successfully negotiated with the SOCKS 4 server. - if (!socks_reply.success()) - { - std::cout << "Connection failed.\n"; - std::cout << "status = 0x" << std::hex << socks_reply.status(); - return 1; - } - - // Form the HTTP request. We specify the "Connection: close" header so that - // the server will close the socket after transmitting the response. This - // will allow us to treat all data up until the EOF as the response. - std::string request = - "GET / HTTP/1.0\r\n" - "Host: www.boost.org\r\n" - "Accept: */*\r\n" - "Connection: close\r\n\r\n"; - - // Send the HTTP request. - asio::write(socket, asio::buffer(request)); - - // Read until EOF, writing data to output as we go. - boost::array response; - asio::error_code error; - while (std::size_t s = socket.read_some( - asio::buffer(response), error)) - std::cout.write(response.data(), s); - if (error != asio::error::eof) - throw asio::system_error(error); - } - catch (std::exception& e) - { - std::cout << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/spawn/.gitignore b/asio/src/examples/cpp03/spawn/.gitignore deleted file mode 100644 index 6b8a121e09..0000000000 --- a/asio/src/examples/cpp03/spawn/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -.deps -.dirstamp -parallel_grep -*.o -*.obj -*.exe -*_server -*_client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/spawn/echo_server.cpp b/asio/src/examples/cpp03/spawn/echo_server.cpp deleted file mode 100644 index f89046cd62..0000000000 --- a/asio/src/examples/cpp03/spawn/echo_server.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// echo_server.cpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using asio::ip::tcp; - -class session : public boost::enable_shared_from_this -{ -public: - explicit session(asio::io_context& io_context) - : strand_(asio::make_strand(io_context)), - socket_(io_context), - timer_(io_context) - { - } - - tcp::socket& socket() - { - return socket_; - } - - void go() - { - asio::spawn(strand_, - boost::bind(&session::echo, - shared_from_this(), boost::placeholders::_1), - asio::detached_t()); - asio::spawn(strand_, - boost::bind(&session::timeout, - shared_from_this(), boost::placeholders::_1), - asio::detached_t()); - } - -private: - void echo(asio::yield_context yield) - { - try - { - char data[128]; - for (;;) - { - timer_.expires_after(asio::chrono::seconds(10)); - std::size_t n = socket_.async_read_some(asio::buffer(data), yield); - asio::async_write(socket_, asio::buffer(data, n), yield); - } - } - catch (std::exception& e) - { - socket_.close(); - timer_.cancel(); - } - } - - void timeout(asio::yield_context yield) - { - while (socket_.is_open()) - { - asio::error_code ignored_ec; - timer_.async_wait(yield[ignored_ec]); - if (timer_.expiry() <= asio::steady_timer::clock_type::now()) - socket_.close(); - } - } - - asio::strand strand_; - tcp::socket socket_; - asio::steady_timer timer_; -}; - -void do_accept(asio::io_context& io_context, - unsigned short port, asio::yield_context yield) -{ - tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v4(), port)); - - for (;;) - { - asio::error_code ec; - boost::shared_ptr new_session(new session(io_context)); - acceptor.async_accept(new_session->socket(), yield[ec]); - if (!ec) new_session->go(); - } -} - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: echo_server \n"; - return 1; - } - - asio::io_context io_context; - - asio::spawn(io_context, - boost::bind(do_accept, boost::ref(io_context), - atoi(argv[1]), boost::placeholders::_1), - asio::detached_t()); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/spawn/parallel_grep.cpp b/asio/src/examples/cpp03/spawn/parallel_grep.cpp deleted file mode 100644 index 5b369be1f4..0000000000 --- a/asio/src/examples/cpp03/spawn/parallel_grep.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// -// parallel_grep.cpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using asio::detached_t; -using asio::dispatch; -using asio::spawn; -using asio::strand; -using asio::thread_pool; -using asio::yield_context; - -void print_match(std::string input_file, std::string line) -{ - std::cout << input_file << ':' << line << std::endl; -} - -void search_file(std::string search_string, std::string input_file, - strand output_strand, yield_context yield) -{ - std::ifstream is(input_file.c_str()); - std::string line; - std::size_t line_num = 0; - while (std::getline(is, line)) - { - // If we find a match, send a message to the output. - if (line.find(search_string) != std::string::npos) - { - dispatch(output_strand, boost::bind(&print_match, input_file, line)); - } - - // Every so often we yield control to another coroutine. - if (++line_num % 10 == 0) - post(yield); - } -} - -int main(int argc, char* argv[]) -{ - try - { - if (argc < 2) - { - std::cerr << "Usage: parallel_grep \n"; - return 1; - } - - // We use a fixed size pool of threads for reading the input files. The - // number of threads is automatically determined based on the number of - // CPUs available in the system. - thread_pool pool; - - // To prevent the output from being garbled, we use a strand to synchronise - // printing. - strand output_strand(pool.get_executor()); - - // Spawn a new coroutine for each file specified on the command line. - std::string search_string = argv[1]; - for (int argn = 2; argn < argc; ++argn) - { - std::string input_file = argv[argn]; - spawn(pool, - boost::bind(&search_file, search_string, - input_file, output_strand, boost::placeholders::_1), - detached_t()); - } - - // Join the thread pool to wait for all the spawned tasks to complete. - pool.join(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/ssl/.gitignore b/asio/src/examples/cpp03/ssl/.gitignore deleted file mode 100644 index a67811253d..0000000000 --- a/asio/src/examples/cpp03/ssl/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -server -client -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/ssl/README b/asio/src/examples/cpp03/ssl/README deleted file mode 100644 index 5d4bc5c813..0000000000 --- a/asio/src/examples/cpp03/ssl/README +++ /dev/null @@ -1,8 +0,0 @@ -The passphrase for both the CA and server private keys is "test". - - -------------------------------------------------------------------------------- -Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) - -Distributed under the 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/asio/src/examples/cpp03/ssl/ca.pem b/asio/src/examples/cpp03/ssl/ca.pem deleted file mode 100644 index 4580bc11bc..0000000000 --- a/asio/src/examples/cpp03/ssl/ca.pem +++ /dev/null @@ -1,50 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIUX3cVQ47QyJp7SOy0RPzP743W9MwwDQYJKoZIhvcNAQEL -BQAwOzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5 -MQ0wCwYDVQQKDARhc2lvMB4XDTIxMTExMTIxMTA1MloXDTI2MTExMDIxMTA1Mlow -OzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5MQ0w -CwYDVQQKDARhc2lvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyURD -LjKxTCkapmWhY0bP1NaaOPzIJTTB0dzREOlmRmBmiHpW7DaRx7qBm6jYDKQ7OCbz -30/j8K4TjHOLIwxzXhXMYTJOcN2giPHNUBvm9oEuDAhYgltArJQnBBEH+3C1hCIv -1+uhTWo0HpGXTeJnvboTZ1YgmbOgr6lMhNiu9QmPX885DxWf6sDq8mRgCDX2x8sk -Ls0HuLSo88Osjx532yEhnrZgexsByhoRD3yrKHV5mWpaunk5BMsP/XMuQHayFmbO -siqnHJoL1znGVH003PcBGmEDmoIUqhLiBi2gWGu1pmckP9loqQUTEn0aLOVclHf4 -slWq344zh4tJCpQMfQIDAQABo1AwTjAdBgNVHQ4EFgQUfiX1CMQrGDi9mIBAg9cg -m0RwLJUwHwYDVR0jBBgwFoAUfiX1CMQrGDi9mIBAg9cgm0RwLJUwDAYDVR0TBAUw -AwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAnDnVNSb8z/pNFaZ6YAZ+ukfNT3jjbGm1 -10BOLqJj8s5A8/JkwjaWhky/DuGXDywgEvzXC18aNAxASeqO8h9pAZtszu6NWB4s -h3r+dEQakMacxrZ+jBL/cYLrUv9r3KMPKxaDnplkamqFA/9eNmoV7vDyGtGPZuD6 -oTROtQqqDSrxthCkqnibAfusi7RmlCdvJa0kVK7krKJZAhi8W9f32+lBPv9oq3Ns -dAxnOj/D3UnhNoIt0EdjqUdLo2U39dt5s5Syj2rFUAgfbc02Rwx65kq8AjTRlW/M -KDpGsifwIB8b7wActMUO8c3GptptNVWmFm5+Mmk54P//P3tIAx9KXw== ------END CERTIFICATE----- ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIPcVUeQ7ZElgCAggA -MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECGKlFVN6/gIlBIIEyJPeknsA5dvV -WK27AZzs4wM6WrsD6ba+kPJyZTpon5pn4eoTiw4UCvo7C+21G9jCqbIbDrgTWHwH -zu6YrBFTZgRUpdLkLsyUsp4UJrZ8xJ7N/jWlG763CyluFE5oBFLz2Vt/DSDSaWdA -sKdxua/1kvw+KYoDqlObMFIspM5TrndcMnWkOgyvQAvnH0NZXFFBa4QGFrwWDrCo -m12CzMLwaPMrNFBffCTqZnL1AajT+EYqPTi+cQ5mkRpZ2cuzhdug2eki1KkD12ZN -3d8Ehl8bfbLEqRE/HnggleRRt7ia1xkzruqQp14JA2UsrioGMF5nvWgWrbyHfpui -KrCsDwDelrArW/GCki53QBQMuH8Q1YmoNrRZwlG257eA1LiJvmxRyIjKYu0RP+Q8 -EOldycy51VsPVPApUbv9r4IJldrIJiwlmRxxM36uKtFhfojnsWzJORDYI8C37uKi -UEPiD4GSEH6C0lGO94IoZPjl9z/rZ0qZx1VRHl3nxZc0AQvvj9bWMbyRwsgb6wod -P8JSy6uEib9UxuenNHzTd48GcNhJbhOqd4IV0XKhi8W1Kil3mMdc3QAwKaLTx12/ -1GrbMui061uyeM6Rf6Xao0PApDnUNmxcFSTsoarG0yH7Q0WZMgKTDCCGhhtZKlE6 -x7pRsnxiFaIpoh32EVIRI+ZXh2rXBcwa2ew0aEccRXtPFvcmdjevkrHuCggc+M+Y -seFqTHVGWf8eS6o08w095DboD0vFpZXZMRfycTbA7BiE4NYE/uc7v5cH3Ax9l2ef -zG7o9idDt+/RX7OcetxDFw4eQbq7PfjvrfXS1DcRUEyJ04emh7oxlkAUUNsFtabN -T0ggvHxcQWkYRE5oPlkbgpwKpK4LDcApXKFwCDKPur2W5Q7KHRfDLtSvZvYarJum -8j2pGpEis/bdTih29ofNsX6a0Yo5Tlj+9+1c/6/Xi7XvRk/Vbgkoa3iVQ3ckdCuZ -vO7cRYZBBs6W/Ti3hWFzPEX9FfcnSUp9bEnH4ASnmUcp8PDBJYeaI6HqpO3XbkbF -l70eDNakd2cDNjQzkFpBT7HO+HtqU3xNt9K0z2gMB7iTDVFyIzh26joCR2O8tiqS -wUJFkoLPb74GSB7WzE+gb4jXX6n9609PUoR3f896mM34uX3CsY8lA+/0ZGpHnFDA -ToKdmz6WKIAw0E20nyzLuLwPZgj7HLcR7zza4raipe9QxIdyJr5O+jzGt+OjSM9b -K1agibRE5DChqQ+P+ikOc6nG7UNyn+lKSjGEbwuzi8F0iugMgcTc/vYO8OWDNGpd -D1euA5OuVPdfatFa16Fyr4MJJIfE83C4/kSj05fdoyb6pJkOjHhUppVMe+ES5kwl -YI8RES2XVJzUSxnWsIM613YlMgIZ9xgcuIADnO7gaKJ4RQG+9wJ853Uo4+n89K7F -Y6KzihuYAUkbAw1pPo1TODom7A/gB9stqRUSQlZWmIgtnJ8wPjt/we0gzPM8LQzb -ye4KOLjH5iquFc4MU4TtN3gvp9P5R9UFrGeMImS5eMUmBQHckDNdIAtMj7M1wUpR -JVrzDXWDjC21sLn95NtNMPb+FRlt/biTV3IE3ZmX0kbuCRoH7b7hhR41Zpoajwl0 -FqYigB5gnVodGUWuBgDUqA== ------END ENCRYPTED PRIVATE KEY----- diff --git a/asio/src/examples/cpp03/ssl/client.cpp b/asio/src/examples/cpp03/ssl/client.cpp deleted file mode 100644 index 3ff20aa887..0000000000 --- a/asio/src/examples/cpp03/ssl/client.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// -// client.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" -#include "asio/ssl.hpp" - -enum { max_length = 1024 }; - -class client -{ -public: - client(asio::io_context& io_context, - asio::ssl::context& context, - asio::ip::tcp::resolver::results_type endpoints) - : socket_(io_context, context) - { - socket_.set_verify_mode(asio::ssl::verify_peer); - socket_.set_verify_callback( - boost::bind(&client::verify_certificate, this, - boost::placeholders::_1, boost::placeholders::_2)); - - asio::async_connect(socket_.lowest_layer(), endpoints, - boost::bind(&client::handle_connect, this, - asio::placeholders::error)); - } - - bool verify_certificate(bool preverified, - asio::ssl::verify_context& ctx) - { - // The verify callback can be used to check whether the certificate that is - // being presented is valid for the peer. For example, RFC 2818 describes - // the steps involved in doing this for HTTPS. Consult the OpenSSL - // documentation for more details. Note that the callback is called once - // for each certificate in the certificate chain, starting from the root - // certificate authority. - - // In this example we will simply print the certificate's subject name. - char subject_name[256]; - X509* cert = X509_STORE_CTX_get_current_cert(ctx.native_handle()); - X509_NAME_oneline(X509_get_subject_name(cert), subject_name, 256); - std::cout << "Verifying " << subject_name << "\n"; - - return preverified; - } - - void handle_connect(const asio::error_code& error) - { - if (!error) - { - socket_.async_handshake(asio::ssl::stream_base::client, - boost::bind(&client::handle_handshake, this, - asio::placeholders::error)); - } - else - { - std::cout << "Connect failed: " << error.message() << "\n"; - } - } - - void handle_handshake(const asio::error_code& error) - { - if (!error) - { - std::cout << "Enter message: "; - std::cin.getline(request_, max_length); - size_t request_length = strlen(request_); - - asio::async_write(socket_, - asio::buffer(request_, request_length), - boost::bind(&client::handle_write, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - std::cout << "Handshake failed: " << error.message() << "\n"; - } - } - - void handle_write(const asio::error_code& error, - size_t bytes_transferred) - { - if (!error) - { - asio::async_read(socket_, - asio::buffer(reply_, bytes_transferred), - boost::bind(&client::handle_read, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - std::cout << "Write failed: " << error.message() << "\n"; - } - } - - void handle_read(const asio::error_code& error, - size_t bytes_transferred) - { - if (!error) - { - std::cout << "Reply: "; - std::cout.write(reply_, bytes_transferred); - std::cout << "\n"; - } - else - { - std::cout << "Read failed: " << error.message() << "\n"; - } - } - -private: - asio::ssl::stream socket_; - char request_[max_length]; - char reply_[max_length]; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: client \n"; - return 1; - } - - asio::io_context io_context; - - asio::ip::tcp::resolver resolver(io_context); - asio::ip::tcp::resolver::results_type endpoints = - resolver.resolve(argv[1], argv[2]); - - asio::ssl::context ctx(asio::ssl::context::sslv23); - ctx.load_verify_file("ca.pem"); - - client c(io_context, ctx, endpoints); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/ssl/dh4096.pem b/asio/src/examples/cpp03/ssl/dh4096.pem deleted file mode 100644 index dc2559c5f8..0000000000 --- a/asio/src/examples/cpp03/ssl/dh4096.pem +++ /dev/null @@ -1,25 +0,0 @@ ------BEGIN X9.42 DH PARAMETERS----- -MIIELQKCAgEA8eEBgatlTk0QKIwUqHsteHJXzEr0xAW7RLeNid8DdGjTnFw68eV+ -s1YbipEqQVTFG+VZPaof9v0CH2KOdbgWD0KRPC49HB8O/wARFKpy5eJltVe1r07w -+V1Vjciqkh/vGq/yFQsbqwyWJy6AelsbHdSC9Bg9pmu4+pbVGW15zK7PkfjfoO9V -JYbhdqFIPg+9NRRWsl/U9UoyeeIGImI9I4k3fqtv311C6VVErFZylCj7nn45L7IY -GfPcCO5E8FD6EqBv5WnhMNYHMJu9brRvOoAyAyWprqR+aVzHd+DFamDQdsuQjKTk -3+r07znWJfjp6FVTzR5SvjrKg1knK5TibIksoKOlsFZ06bGkFWHjqXNAKhnSpCiU -GJd0qe7pTD+TGQJGWskJpoph+tkICUa+6MyzP9+U6T9hISIY/BpVuWn/iwdLqsvV -s5bg2RjRraww/4Rjm0NyEOTk2MxaLB9gcyu6zcrhX5XRiMgt+jhKwEMwJCEJYkxn -C0yv08A5v6RceFm1jY+8FT0IzRqsWIGV7beNdqtE0B4LBTuN1yQ6x8CKEb6mbIHG -d0XLGppELhD8QUwAr5HiVGTAsS9JlMGgXVkyDtxrVSeS1zHWt77skRQ9UlfJfYMm -5wxHj5QCdQ7ma3oMMZBZutNlkevMzYHIxwqhZstf4ud0j0VMftwZ3GMCggIBAJL7 -cU6/YSxzYDGUcPc6WGT+FAghR0LdhT3Q3Xz1rQRBwSSMPm9NZhyJC3fb+hBl/44X -AHOu1/3dYIWlXPMuHZZdtlt+hkD/sIob16By20Z0p81Kvh3HQglVDJGlFzTmQbTd -CM/EP8eJFiNeMcJB0RgeKyzikRsV4r/acZZM56swTlsRvSDFMh3v9YyYTZbCTwxm -PIVOsxI8uBoWRCzY3yWzjmlZ2u5TR+Z0IVonmNqk6XAKRgxV12YfQVXzzpPZQA9S -GHoD/NQoMdBAi3p4pLEYJ5qMRLYPQbBfSNu5eP9e5uZOiBp/28bVnzEelDGuFupr -lvywkZEVL1KaYtZ/dGkPFXt+A7mNsw5xeDTRjgL4uUJvCNIkjgVEfIrLdUf5IVsU -V8BgunAvgfH+Hy6Tx89v/QGsUWJPhjkSZnXwJ7Ipcsm+Zg0zAZwKDZEQtDLXVPRL -OfCfXMXvlw2u6OHlhSbqO69zZG3dJTlcnjy06n4JYcUim7Mj3Kduige6VWofeEk9 -M/kHrPqNdFE5tHLh2nHcw9yExKHN+l/OUGAvNDfOVS+S+fNSKT0RfC9dMpHLN+Ok -fGuskGzLQAVYF+DYEcnJ++0LEFtd0J381ndSc0iJuH60rKDTqxoRqv7lcdwLFlEV -sQSRoas8s+y+b3FfSu7j0p44qLG9oxZ/WFcWnuUyAiEAjvAD9p3bw8AH0s7dUrX/ -RT1Ge+J/n0tlsgw+LY3zafE= ------END X9.42 DH PARAMETERS----- diff --git a/asio/src/examples/cpp03/ssl/server.cpp b/asio/src/examples/cpp03/ssl/server.cpp deleted file mode 100644 index 447d94088c..0000000000 --- a/asio/src/examples/cpp03/ssl/server.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// -// server.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include "asio.hpp" -#include "asio/ssl.hpp" - -typedef asio::ssl::stream ssl_socket; - -class session -{ -public: - session(asio::io_context& io_context, - asio::ssl::context& context) - : socket_(io_context, context) - { - } - - ssl_socket::lowest_layer_type& socket() - { - return socket_.lowest_layer(); - } - - void start() - { - socket_.async_handshake(asio::ssl::stream_base::server, - boost::bind(&session::handle_handshake, this, - asio::placeholders::error)); - } - - void handle_handshake(const asio::error_code& error) - { - if (!error) - { - socket_.async_read_some(asio::buffer(data_, max_length), - boost::bind(&session::handle_read, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - delete this; - } - } - - void handle_read(const asio::error_code& error, - size_t bytes_transferred) - { - if (!error) - { - asio::async_write(socket_, - asio::buffer(data_, bytes_transferred), - boost::bind(&session::handle_write, this, - asio::placeholders::error)); - } - else - { - delete this; - } - } - - void handle_write(const asio::error_code& error) - { - if (!error) - { - socket_.async_read_some(asio::buffer(data_, max_length), - boost::bind(&session::handle_read, this, - asio::placeholders::error, - asio::placeholders::bytes_transferred)); - } - else - { - delete this; - } - } - -private: - ssl_socket socket_; - enum { max_length = 1024 }; - char data_[max_length]; -}; - -class server -{ -public: - server(asio::io_context& io_context, unsigned short port) - : io_context_(io_context), - acceptor_(io_context, - asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port)), - context_(asio::ssl::context::sslv23) - { - context_.set_options( - asio::ssl::context::default_workarounds - | asio::ssl::context::no_sslv2 - | asio::ssl::context::single_dh_use); - context_.set_password_callback(boost::bind(&server::get_password, this)); - context_.use_certificate_chain_file("server.pem"); - context_.use_private_key_file("server.pem", asio::ssl::context::pem); - context_.use_tmp_dh_file("dh4096.pem"); - - start_accept(); - } - - std::string get_password() const - { - return "test"; - } - - void start_accept() - { - session* new_session = new session(io_context_, context_); - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, this, new_session, - asio::placeholders::error)); - } - - void handle_accept(session* new_session, - const asio::error_code& error) - { - if (!error) - { - new_session->start(); - } - else - { - delete new_session; - } - - start_accept(); - } - -private: - asio::io_context& io_context_; - asio::ip::tcp::acceptor acceptor_; - asio::ssl::context context_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: server \n"; - return 1; - } - - asio::io_context io_context; - - using namespace std; // For atoi. - server s(io_context, atoi(argv[1])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/ssl/server.pem b/asio/src/examples/cpp03/ssl/server.pem deleted file mode 100644 index a7bcba738a..0000000000 --- a/asio/src/examples/cpp03/ssl/server.pem +++ /dev/null @@ -1,99 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDDjCCAfYCFGGcJXlIeQHiq/qOakbISU5cihPvMA0GCSqGSIb3DQEBCwUAMDsx -CzAJBgNVBAYTAkFVMQwwCgYDVQQIDANOU1cxDzANBgNVBAcMBlN5ZG5leTENMAsG -A1UECgwEYXNpbzAeFw0yMTExMTEyMTExNDRaFw0yNjExMTAyMTExNDRaMEwxCzAJ -BgNVBAYTAkFVMQwwCgYDVQQIDANOU1cxDzANBgNVBAcMBlN5ZG5leTENMAsGA1UE -CgwEYXNpbzEPMA0GA1UECwwGc2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAu67TzZCFNTZ5c1gKwXfdTH3bP0OB5n6dqXGK6jkPb699dyM4oPtY -2f+OyxJspk8D5pX6HuZ+hLGAsHxfCN+A3RegVZJCR/gXrrMPl/6PfDxtkeFXWy+6 -NAPxqppMj8gbX/czTdNFwgW4J8/RLyH53utjAGQtCRr97EbBOsTSeOmyAxbw4mRt -EvHjacKFcSZzJDlyxCia37791MulZ4lwOZZlke5NzoOqkBIAusQgg7fMWDvH27PD -T+taIyBsYTVJWHf5kMklAlWYXZvNjZp/QGt13lDORg2aSc/P2pE4iLyhbZcpuW+W -nHB7IY1wjDL55/ORCjz3VlNIAMXHP5YQxwIDAQABMA0GCSqGSIb3DQEBCwUAA4IB -AQC3iiwQTgDP4ixulisYIGlJb8iuhxH9G41hm8dF/1qlIfXWxsbjb+g7M5U/3JCb -fwCGoz7uBdj/CKkIb5wx83GVC1yVLbNSvCIS827qxic4GACEYGGAy4Ub5tUCQrLr -JUQTP1WVJcgiKvk7OAcXdA+k/CcNXH153gUPDZz+/BedXe2VbM6LDsqPeSxXfbZN -AWXARAuly7cQk/xkYkPldRRhx4htNCbnkG1qyEqNcYQN1SY9Qhbrm2HkAUntzQ7G -umo4JdbIX6MJ5fYNs+yN/lJB7PiJP8Mz1AtOz4x9JxcLyuB6sapT8Tj53n9g/+m1 -Tqd8lHpWe6oM0sgdWfzdBNir ------END CERTIFICATE----- ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,9E0E6B9970E055F1 - -oFvN3t50B2TSeNsRo1vwhVYlMmt0w3MD3Ar75fti4fRhBrWoH4rBPrSouWK4OMDK -CakfVhzJIEvaMav843grS4V+ooAsfnAtiQiQj+5xjZ8PlCuWir5gyjgqeN4zN6ZT -2s/oEy5Kx7Ru5AWMkv+NPW5l3iS3c+Hupfb/auITwECSCCsCBxgNtJ8z0iXjv9Dr -hqvqcI+4F5DSiol3QhitbpQ/k2PKu92AZhPcr9e5HrqeUD7aqfX2q3i+tnJvxC93 -0mvy133bX2ZAGAKMheW/GuzcETfwU80wvmrwHXI9rnuAUaJhrDiIZQ79gubZ0Pcm -w4Y6Z5xxeErb7zKBi+pHKst8MJ7rfSz/N878su6cpESRC/w1paVX7m8/q61kzBkj -+h2qe9DupXBejQkriN+Z858nFtBKbWlFsmAg1FLZonworTUfV2c7S9yzMV/29VOE -T0Bt8BU1Hp+bCjreF4JGbnUJnRQoASpisfUkrD6Ar4GI56Edkkx6hkF0cXdcvfCN -qyhxzcvf/aV1M2kcpBRX9mIfjoFMFNz7uRIxyqPLaDkigwJemoaBo3n9/W5F7N7B -AGNEZ3QhUlc8EyWpGRZRzMevu5wdz1b2+MqItOhPXUo2XcLEj2iFkVDdbj/d9jQH -9ZIe4hQTSf784tAzt2Jp2RHmm22390GB1jdzG/CzbGlAKmaTTEe4FJcd/eLOEZuD -4+iFsEb/bWcCyXkBKkdEoDDMJW8xi5d/1ezJM03nqhvkekDqyhJUJPCbmY1SCX1X -4AO40jJmWQxwj26Pnnncacz4tuecZNqovz+POpKQSIctrQSV4wgf35137KBt7/O7 -EU0N7Qj4xTigyGkEHCZt7BgD8fFrxiP1OkUmFRHEE7Dxiagz6omJV8ien+p9wIgS -QcqkJlgKMwVepjuCuEyvg5oIkAPvp24yhePSJkEvvoDLvM2Kub/CM+UkN8dSgsZk -+ZBE9Oi62AWWow8/ib8Um5DNIEZsq+5CQLeBG7f5kTIBAoA9UceaEgbxzOVUCBcX -L7QsJ3pZ/ei1qx/9tChO/OXa9tleXcjGg7/q/6i6pUyZuqZlt+hk+3HtFmTXIjsM -chbUSMEJ2isv9MDamTtunt9N92A6OxUkAs68kCO/bzotldXMKZVjOohNnML5q/3U -vpsuN8NNwaNHCAM7pjols4V7ebX1lDZFR1hbj+szKMhVKzFfig1lRHafgRrR6H6P -mUK16lKzUbmvwv2IU/3wck+4UNeB/+lRmfAfBasQytnbt+5fwwNkVSrDY2Kxe0nz -2k3eIYST+ygxGuNrW9rnFbBpTJb0OE5cpgun8xxDE91AmL550AcZff+9ulDBhZg1 -eMoKUALlEdDNPffVTH8Iupn0jMnJsjXynztcEVhx4h2aA5X6/2i035uEybCn33qP -J7g30oe2C69BSC0YmkT3MjF6Wrhy+M8dU0dDggRhY6JSS8wESvwGenaPi7SZlbxb -Elmc44bHros1YfGl/xDdhju134/aMBG1GlZlReI+Rwnp9DCp04xiiJb9YKyUNaGY -7BTGWyie/WYYKbX1ZlxqWA9jxow8PM1XYHuanau1/aYT16L7E83HG3qkyuFIlLJh ------END RSA PRIVATE KEY----- ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIUX3cVQ47QyJp7SOy0RPzP743W9MwwDQYJKoZIhvcNAQEL -BQAwOzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5 -MQ0wCwYDVQQKDARhc2lvMB4XDTIxMTExMTIxMTA1MloXDTI2MTExMDIxMTA1Mlow -OzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5MQ0w -CwYDVQQKDARhc2lvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyURD -LjKxTCkapmWhY0bP1NaaOPzIJTTB0dzREOlmRmBmiHpW7DaRx7qBm6jYDKQ7OCbz -30/j8K4TjHOLIwxzXhXMYTJOcN2giPHNUBvm9oEuDAhYgltArJQnBBEH+3C1hCIv -1+uhTWo0HpGXTeJnvboTZ1YgmbOgr6lMhNiu9QmPX885DxWf6sDq8mRgCDX2x8sk -Ls0HuLSo88Osjx532yEhnrZgexsByhoRD3yrKHV5mWpaunk5BMsP/XMuQHayFmbO -siqnHJoL1znGVH003PcBGmEDmoIUqhLiBi2gWGu1pmckP9loqQUTEn0aLOVclHf4 -slWq344zh4tJCpQMfQIDAQABo1AwTjAdBgNVHQ4EFgQUfiX1CMQrGDi9mIBAg9cg -m0RwLJUwHwYDVR0jBBgwFoAUfiX1CMQrGDi9mIBAg9cgm0RwLJUwDAYDVR0TBAUw -AwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAnDnVNSb8z/pNFaZ6YAZ+ukfNT3jjbGm1 -10BOLqJj8s5A8/JkwjaWhky/DuGXDywgEvzXC18aNAxASeqO8h9pAZtszu6NWB4s -h3r+dEQakMacxrZ+jBL/cYLrUv9r3KMPKxaDnplkamqFA/9eNmoV7vDyGtGPZuD6 -oTROtQqqDSrxthCkqnibAfusi7RmlCdvJa0kVK7krKJZAhi8W9f32+lBPv9oq3Ns -dAxnOj/D3UnhNoIt0EdjqUdLo2U39dt5s5Syj2rFUAgfbc02Rwx65kq8AjTRlW/M -KDpGsifwIB8b7wActMUO8c3GptptNVWmFm5+Mmk54P//P3tIAx9KXw== ------END CERTIFICATE----- ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIPcVUeQ7ZElgCAggA -MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECGKlFVN6/gIlBIIEyJPeknsA5dvV -WK27AZzs4wM6WrsD6ba+kPJyZTpon5pn4eoTiw4UCvo7C+21G9jCqbIbDrgTWHwH -zu6YrBFTZgRUpdLkLsyUsp4UJrZ8xJ7N/jWlG763CyluFE5oBFLz2Vt/DSDSaWdA -sKdxua/1kvw+KYoDqlObMFIspM5TrndcMnWkOgyvQAvnH0NZXFFBa4QGFrwWDrCo -m12CzMLwaPMrNFBffCTqZnL1AajT+EYqPTi+cQ5mkRpZ2cuzhdug2eki1KkD12ZN -3d8Ehl8bfbLEqRE/HnggleRRt7ia1xkzruqQp14JA2UsrioGMF5nvWgWrbyHfpui -KrCsDwDelrArW/GCki53QBQMuH8Q1YmoNrRZwlG257eA1LiJvmxRyIjKYu0RP+Q8 -EOldycy51VsPVPApUbv9r4IJldrIJiwlmRxxM36uKtFhfojnsWzJORDYI8C37uKi -UEPiD4GSEH6C0lGO94IoZPjl9z/rZ0qZx1VRHl3nxZc0AQvvj9bWMbyRwsgb6wod -P8JSy6uEib9UxuenNHzTd48GcNhJbhOqd4IV0XKhi8W1Kil3mMdc3QAwKaLTx12/ -1GrbMui061uyeM6Rf6Xao0PApDnUNmxcFSTsoarG0yH7Q0WZMgKTDCCGhhtZKlE6 -x7pRsnxiFaIpoh32EVIRI+ZXh2rXBcwa2ew0aEccRXtPFvcmdjevkrHuCggc+M+Y -seFqTHVGWf8eS6o08w095DboD0vFpZXZMRfycTbA7BiE4NYE/uc7v5cH3Ax9l2ef -zG7o9idDt+/RX7OcetxDFw4eQbq7PfjvrfXS1DcRUEyJ04emh7oxlkAUUNsFtabN -T0ggvHxcQWkYRE5oPlkbgpwKpK4LDcApXKFwCDKPur2W5Q7KHRfDLtSvZvYarJum -8j2pGpEis/bdTih29ofNsX6a0Yo5Tlj+9+1c/6/Xi7XvRk/Vbgkoa3iVQ3ckdCuZ -vO7cRYZBBs6W/Ti3hWFzPEX9FfcnSUp9bEnH4ASnmUcp8PDBJYeaI6HqpO3XbkbF -l70eDNakd2cDNjQzkFpBT7HO+HtqU3xNt9K0z2gMB7iTDVFyIzh26joCR2O8tiqS -wUJFkoLPb74GSB7WzE+gb4jXX6n9609PUoR3f896mM34uX3CsY8lA+/0ZGpHnFDA -ToKdmz6WKIAw0E20nyzLuLwPZgj7HLcR7zza4raipe9QxIdyJr5O+jzGt+OjSM9b -K1agibRE5DChqQ+P+ikOc6nG7UNyn+lKSjGEbwuzi8F0iugMgcTc/vYO8OWDNGpd -D1euA5OuVPdfatFa16Fyr4MJJIfE83C4/kSj05fdoyb6pJkOjHhUppVMe+ES5kwl -YI8RES2XVJzUSxnWsIM613YlMgIZ9xgcuIADnO7gaKJ4RQG+9wJ853Uo4+n89K7F -Y6KzihuYAUkbAw1pPo1TODom7A/gB9stqRUSQlZWmIgtnJ8wPjt/we0gzPM8LQzb -ye4KOLjH5iquFc4MU4TtN3gvp9P5R9UFrGeMImS5eMUmBQHckDNdIAtMj7M1wUpR -JVrzDXWDjC21sLn95NtNMPb+FRlt/biTV3IE3ZmX0kbuCRoH7b7hhR41Zpoajwl0 -FqYigB5gnVodGUWuBgDUqA== ------END ENCRYPTED PRIVATE KEY----- diff --git a/asio/src/examples/cpp03/timeouts/.gitignore b/asio/src/examples/cpp03/timeouts/.gitignore deleted file mode 100644 index dda7f39c3c..0000000000 --- a/asio/src/examples/cpp03/timeouts/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*_client -server -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp b/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp deleted file mode 100644 index edc6ad55f5..0000000000 --- a/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp +++ /dev/null @@ -1,311 +0,0 @@ -// -// async_tcp_client.cpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "asio/buffer.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/read_until.hpp" -#include "asio/steady_timer.hpp" -#include "asio/write.hpp" -#include -#include -#include - -using asio::steady_timer; -using asio::ip::tcp; - -// -// This class manages socket timeouts by applying the concept of a deadline. -// Some asynchronous operations are given deadlines by which they must complete. -// Deadlines are enforced by an "actor" that persists for the lifetime of the -// client object: -// -// +----------------+ -// | | -// | check_deadline |<---+ -// | | | -// +----------------+ | async_wait() -// | | -// +---------+ -// -// If the deadline actor determines that the deadline has expired, the socket -// is closed and any outstanding operations are consequently cancelled. -// -// Connection establishment involves trying each endpoint in turn until a -// connection is successful, or the available endpoints are exhausted. If the -// deadline actor closes the socket, the connect actor is woken up and moves to -// the next endpoint. -// -// +---------------+ -// | | -// | start_connect |<---+ -// | | | -// +---------------+ | -// | | -// async_- | +----------------+ -// connect() | | | -// +--->| handle_connect | -// | | -// +----------------+ -// : -// Once a connection is : -// made, the connect : -// actor forks in two - : -// : -// an actor for reading : and an actor for -// inbound messages: : sending heartbeats: -// : -// +------------+ : +-------------+ -// | |<- - - - -+- - - - ->| | -// | start_read | | start_write |<---+ -// | |<---+ | | | -// +------------+ | +-------------+ | async_wait() -// | | | | -// async_- | +-------------+ async_- | +--------------+ -// read_- | | | write() | | | -// until() +--->| handle_read | +--->| handle_write | -// | | | | -// +-------------+ +--------------+ -// -// The input actor reads messages from the socket, where messages are delimited -// by the newline character. The deadline for a complete message is 30 seconds. -// -// The heartbeat actor sends a heartbeat (a message that consists of a single -// newline character) every 10 seconds. In this example, no deadline is applied -// to message sending. -// -class client -{ -public: - client(asio::io_context& io_context) - : stopped_(false), - socket_(io_context), - deadline_(io_context), - heartbeat_timer_(io_context) - { - } - - // Called by the user of the client class to initiate the connection process. - // The endpoints will have been obtained using a tcp::resolver. - void start(tcp::resolver::results_type endpoints) - { - // Start the connect actor. - endpoints_ = endpoints; - start_connect(endpoints_.begin()); - - // Start the deadline actor. You will note that we're not setting any - // particular deadline here. Instead, the connect and input actors will - // update the deadline prior to each asynchronous operation. - deadline_.async_wait(boost::bind(&client::check_deadline, this)); - } - - // This function terminates all the actors to shut down the connection. It - // may be called by the user of the client class, or by the class itself in - // response to graceful termination or an unrecoverable error. - void stop() - { - stopped_ = true; - asio::error_code ignored_ec; - socket_.close(ignored_ec); - deadline_.cancel(); - heartbeat_timer_.cancel(); - } - -private: - void start_connect(tcp::resolver::results_type::iterator endpoint_iter) - { - if (endpoint_iter != endpoints_.end()) - { - std::cout << "Trying " << endpoint_iter->endpoint() << "...\n"; - - // Set a deadline for the connect operation. - deadline_.expires_after(asio::chrono::seconds(60)); - - // Start the asynchronous connect operation. - socket_.async_connect(endpoint_iter->endpoint(), - boost::bind(&client::handle_connect, this, - boost::placeholders::_1, endpoint_iter)); - } - else - { - // There are no more endpoints to try. Shut down the client. - stop(); - } - } - - void handle_connect(const asio::error_code& ec, - tcp::resolver::results_type::iterator endpoint_iter) - { - if (stopped_) - return; - - // The async_connect() function automatically opens the socket at the start - // of the asynchronous operation. If the socket is closed at this time then - // the timeout handler must have run first. - if (!socket_.is_open()) - { - std::cout << "Connect timed out\n"; - - // Try the next available endpoint. - start_connect(++endpoint_iter); - } - - // Check if the connect operation failed before the deadline expired. - else if (ec) - { - std::cout << "Connect error: " << ec.message() << "\n"; - - // We need to close the socket used in the previous connection attempt - // before starting a new one. - socket_.close(); - - // Try the next available endpoint. - start_connect(++endpoint_iter); - } - - // Otherwise we have successfully established a connection. - else - { - std::cout << "Connected to " << endpoint_iter->endpoint() << "\n"; - - // Start the input actor. - start_read(); - - // Start the heartbeat actor. - start_write(); - } - } - - void start_read() - { - // Set a deadline for the read operation. - deadline_.expires_after(asio::chrono::seconds(30)); - - // Start an asynchronous operation to read a newline-delimited message. - asio::async_read_until(socket_, - asio::dynamic_buffer(input_buffer_), '\n', - boost::bind(&client::handle_read, this, - boost::placeholders::_1, boost::placeholders::_2)); - } - - void handle_read(const asio::error_code& ec, std::size_t n) - { - if (stopped_) - return; - - if (!ec) - { - // Extract the newline-delimited message from the buffer. - std::string line(input_buffer_.substr(0, n - 1)); - input_buffer_.erase(0, n); - - // Empty messages are heartbeats and so ignored. - if (!line.empty()) - { - std::cout << "Received: " << line << "\n"; - } - - start_read(); - } - else - { - std::cout << "Error on receive: " << ec.message() << "\n"; - - stop(); - } - } - - void start_write() - { - if (stopped_) - return; - - // Start an asynchronous operation to send a heartbeat message. - asio::async_write(socket_, asio::buffer("\n", 1), - boost::bind(&client::handle_write, this, boost::placeholders::_1)); - } - - void handle_write(const asio::error_code& ec) - { - if (stopped_) - return; - - if (!ec) - { - // Wait 10 seconds before sending the next heartbeat. - heartbeat_timer_.expires_after(asio::chrono::seconds(10)); - heartbeat_timer_.async_wait(boost::bind(&client::start_write, this)); - } - else - { - std::cout << "Error on heartbeat: " << ec.message() << "\n"; - - stop(); - } - } - - void check_deadline() - { - if (stopped_) - return; - - // Check whether the deadline has passed. We compare the deadline against - // the current time since a new asynchronous operation may have moved the - // deadline before this actor had a chance to run. - if (deadline_.expiry() <= steady_timer::clock_type::now()) - { - // The deadline has passed. The socket is closed so that any outstanding - // asynchronous operations are cancelled. - socket_.close(); - - // There is no longer an active deadline. The expiry is set to the - // maximum time point so that the actor takes no action until a new - // deadline is set. - deadline_.expires_at(steady_timer::time_point::max()); - } - - // Put the actor back to sleep. - deadline_.async_wait(boost::bind(&client::check_deadline, this)); - } - -private: - bool stopped_; - tcp::resolver::results_type endpoints_; - tcp::socket socket_; - std::string input_buffer_; - steady_timer deadline_; - steady_timer heartbeat_timer_; -}; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 3) - { - std::cerr << "Usage: client \n"; - return 1; - } - - asio::io_context io_context; - tcp::resolver r(io_context); - client c(io_context); - - c.start(r.resolve(argv[1], argv[2])); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp b/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp deleted file mode 100644 index 4493ba5cf6..0000000000 --- a/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// -// blocking_tcp_client.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "asio/buffer.hpp" -#include "asio/connect.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/read_until.hpp" -#include "asio/system_error.hpp" -#include "asio/write.hpp" -#include -#include -#include -#include -#include - -using asio::ip::tcp; -using boost::lambda::bind; -using boost::lambda::var; -using boost::lambda::_1; -using boost::lambda::_2; - -//---------------------------------------------------------------------- - -// -// This class manages socket timeouts by running the io_context using the timed -// io_context::run_for() member function. Each asynchronous operation is given -// a timeout within which it must complete. The socket operations themselves -// use boost::lambda function objects as completion handlers. For a given -// socket operation, the client object runs the io_context to block thread -// execution until the operation completes or the timeout is reached. If the -// io_context::run_for() function times out, the socket is closed and the -// outstanding asynchronous operation is cancelled. -// -class client -{ -public: - client() - : socket_(io_context_) - { - } - - void connect(const std::string& host, const std::string& service, - asio::chrono::steady_clock::duration timeout) - { - // Resolve the host name and service to a list of endpoints. - tcp::resolver::results_type endpoints = - tcp::resolver(io_context_).resolve(host, service); - - // Start the asynchronous operation itself. The boost::lambda function - // object is used as a callback and will update the ec variable when the - // operation completes. The blocking_udp_client.cpp example shows how you - // can use boost::bind rather than boost::lambda. - asio::error_code ec; - asio::async_connect(socket_, endpoints, var(ec) = _1); - - // Run the operation until it completes, or until the timeout. - run(timeout); - - // Determine whether a connection was successfully established. - if (ec) - throw asio::system_error(ec); - } - - std::string read_line(asio::chrono::steady_clock::duration timeout) - { - // Start the asynchronous operation. The boost::lambda function object is - // used as a callback and will update the ec variable when the operation - // completes. The blocking_udp_client.cpp example shows how you can use - // boost::bind rather than boost::lambda. - asio::error_code ec; - std::size_t n = 0; - asio::async_read_until(socket_, - asio::dynamic_buffer(input_buffer_), - '\n', (var(ec) = _1, var(n) = _2)); - - // Run the operation until it completes, or until the timeout. - run(timeout); - - // Determine whether the read completed successfully. - if (ec) - throw asio::system_error(ec); - - std::string line(input_buffer_.substr(0, n - 1)); - input_buffer_.erase(0, n); - return line; - } - - void write_line(const std::string& line, - asio::chrono::steady_clock::duration timeout) - { - std::string data = line + "\n"; - - // Start the asynchronous operation. The boost::lambda function object is - // used as a callback and will update the ec variable when the operation - // completes. The blocking_udp_client.cpp example shows how you can use - // boost::bind rather than boost::lambda. - asio::error_code ec; - asio::async_write(socket_, asio::buffer(data), var(ec) = _1); - - // Run the operation until it completes, or until the timeout. - run(timeout); - - // Determine whether the read completed successfully. - if (ec) - throw asio::system_error(ec); - } - -private: - void run(asio::chrono::steady_clock::duration timeout) - { - // Restart the io_context, as it may have been left in the "stopped" state - // by a previous operation. - io_context_.restart(); - - // Block until the asynchronous operation has completed, or timed out. If - // the pending asynchronous operation is a composed operation, the deadline - // applies to the entire operation, rather than individual operations on - // the socket. - io_context_.run_for(timeout); - - // If the asynchronous operation completed successfully then the io_context - // would have been stopped due to running out of work. If it was not - // stopped, then the io_context::run_for call must have timed out. - if (!io_context_.stopped()) - { - // Close the socket to cancel the outstanding asynchronous operation. - socket_.close(); - - // Run the io_context again until the operation completes. - io_context_.run(); - } - } - - asio::io_context io_context_; - tcp::socket socket_; - std::string input_buffer_; -}; - -//---------------------------------------------------------------------- - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 4) - { - std::cerr << "Usage: blocking_tcp_client \n"; - return 1; - } - - client c; - c.connect(argv[1], argv[2], asio::chrono::seconds(10)); - - asio::chrono::steady_clock::time_point time_sent = - asio::chrono::steady_clock::now(); - - c.write_line(argv[3], asio::chrono::seconds(10)); - - for (;;) - { - std::string line = c.read_line(asio::chrono::seconds(10)); - - // Keep going until we get back the line that was sent. - if (line == argv[3]) - break; - } - - asio::chrono::steady_clock::time_point time_received = - asio::chrono::steady_clock::now(); - - std::cout << "Round trip time: "; - std::cout << asio::chrono::duration_cast< - asio::chrono::microseconds>( - time_received - time_sent).count(); - std::cout << " microseconds\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp b/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp deleted file mode 100644 index f422a838b2..0000000000 --- a/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// -// blocking_token_tcp_client.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "asio/connect.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/read_until.hpp" -#include "asio/streambuf.hpp" -#include "asio/system_error.hpp" -#include "asio/write.hpp" -#include -#include -#include -#include - -using asio::ip::tcp; - -// We will use our sockets only with an io_context. -typedef asio::basic_stream_socket tcp_socket; - -//---------------------------------------------------------------------- - -// A custom completion token that makes asynchronous operations behave as -// though they are blocking calls with a timeout. -struct close_after -{ - close_after(asio::chrono::steady_clock::duration t, tcp_socket& s) - : timeout_(t), socket_(s) - { - } - - // The maximum time to wait for an asynchronous operation to complete. - asio::chrono::steady_clock::duration timeout_; - - // The socket to be closed if the operation does not complete in time. - tcp_socket& socket_; -}; - -namespace asio { - -// The async_result template is specialised to allow the close_after token to -// be used with asynchronous operations that have a completion signature of -// void(error_code, T). Generalising this for all completion signature forms is -// left as an exercise for the reader. -template -class async_result -{ -public: - // An asynchronous operation's initiating function automatically creates an - // completion_handler_type object from the token. This function object is - // then called on completion of the asynchronous operation. - class completion_handler_type - { - public: - completion_handler_type(const close_after& token) - : token_(token) - { - } - - void operator()(asio::error_code ec, T t) - { - *ec_ = ec; - *t_ = t; - } - - private: - friend class async_result; - close_after token_; - asio::error_code* ec_; - T* t_; - }; - - // The async_result constructor associates the completion handler object with - // the result of the initiating function. - explicit async_result(completion_handler_type& h) - : timeout_(h.token_.timeout_), - socket_(h.token_.socket_) - { - h.ec_ = &ec_; - h.t_ = &t_; - } - - // The return_type typedef determines the result type of the asynchronous - // operation's initiating function. - typedef T return_type; - - // The get() function is used to obtain the result of the asynchronous - // operation's initiating function. For the close_after completion token, we - // use this function to run the io_context until the operation is complete. - return_type get() - { - asio::io_context& io_context = asio::query( - socket_.get_executor(), asio::execution::context); - - // Restart the io_context, as it may have been left in the "stopped" state - // by a previous operation. - io_context.restart(); - - // Block until the asynchronous operation has completed, or timed out. If - // the pending asynchronous operation is a composed operation, the deadline - // applies to the entire operation, rather than individual operations on - // the socket. - io_context.run_for(timeout_); - - // If the asynchronous operation completed successfully then the io_context - // would have been stopped due to running out of work. If it was not - // stopped, then the io_context::run_for call must have timed out and the - // operation is still incomplete. - if (!io_context.stopped()) - { - // Close the socket to cancel the outstanding asynchronous operation. - socket_.close(); - - // Run the io_context again until the operation completes. - io_context.run(); - } - - // If the operation failed, throw an exception. Otherwise return the result. - return ec_ ? throw asio::system_error(ec_) : t_; - } - -private: - asio::chrono::steady_clock::duration timeout_; - tcp_socket& socket_; - asio::error_code ec_; - T t_; -}; - -} // namespace asio - -//---------------------------------------------------------------------- - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 4) - { - std::cerr << "Usage: blocking_tcp_client \n"; - return 1; - } - - asio::io_context io_context; - - // Resolve the host name and service to a list of endpoints. - tcp::resolver::results_type endpoints = - tcp::resolver(io_context).resolve(argv[1], argv[2]); - - tcp_socket socket(io_context); - - // Run an asynchronous connect operation with a timeout. - asio::async_connect(socket, endpoints, - close_after(asio::chrono::seconds(10), socket)); - - asio::chrono::steady_clock::time_point time_sent = - asio::chrono::steady_clock::now(); - - // Run an asynchronous write operation with a timeout. - std::string msg = argv[3] + std::string("\n"); - asio::async_write(socket, asio::buffer(msg), - close_after(asio::chrono::seconds(10), socket)); - - for (std::string input_buffer;;) - { - // Run an asynchronous read operation with a timeout. - std::size_t n = asio::async_read_until(socket, - asio::dynamic_buffer(input_buffer), '\n', - close_after(asio::chrono::seconds(10), socket)); - - std::string line(input_buffer.substr(0, n - 1)); - input_buffer.erase(0, n); - - // Keep going until we get back the line that was sent. - if (line == argv[3]) - break; - } - - asio::chrono::steady_clock::time_point time_received = - asio::chrono::steady_clock::now(); - - std::cout << "Round trip time: "; - std::cout << asio::chrono::duration_cast< - asio::chrono::microseconds>( - time_received - time_sent).count(); - std::cout << " microseconds\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp b/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp deleted file mode 100644 index 5c8e2f5767..0000000000 --- a/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// -// blocking_udp_client.cpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 "asio/buffer.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/udp.hpp" -#include -#include -#include - -using asio::ip::udp; - -//---------------------------------------------------------------------- - -// -// This class manages socket timeouts by running the io_context using the timed -// io_context::run_for() member function. Each asynchronous operation is given -// a timeout within which it must complete. The socket operations themselves -// use boost::bind to specify the completion handler: -// -// +---------------+ -// | | -// | receive | -// | | -// +---------------+ -// | -// async_- | +----------------+ -// receive() | | | -// +--->| handle_receive | -// | | -// +----------------+ -// -// For a given socket operation, the client object runs the io_context to block -// thread execution until the operation completes or the timeout is reached. If -// the io_context::run_for() function times out, the socket is closed and the -// outstanding asynchronous operation is cancelled. -// -class client -{ -public: - client(const udp::endpoint& listen_endpoint) - : socket_(io_context_, listen_endpoint) - { - } - - std::size_t receive(const asio::mutable_buffer& buffer, - asio::chrono::steady_clock::duration timeout, - asio::error_code& ec) - { - // Start the asynchronous operation. The handle_receive function used as a - // callback will update the ec and length variables. - std::size_t length = 0; - socket_.async_receive(asio::buffer(buffer), - boost::bind(&client::handle_receive, - boost::placeholders::_1, boost::placeholders::_2, &ec, &length)); - - // Run the operation until it completes, or until the timeout. - run(timeout); - - return length; - } - -private: - void run(asio::chrono::steady_clock::duration timeout) - { - // Restart the io_context, as it may have been left in the "stopped" state - // by a previous operation. - io_context_.restart(); - - // Block until the asynchronous operation has completed, or timed out. If - // the pending asynchronous operation is a composed operation, the deadline - // applies to the entire operation, rather than individual operations on - // the socket. - io_context_.run_for(timeout); - - // If the asynchronous operation completed successfully then the io_context - // would have been stopped due to running out of work. If it was not - // stopped, then the io_context::run_for call must have timed out. - if (!io_context_.stopped()) - { - // Cancel the outstanding asynchronous operation. - socket_.cancel(); - - // Run the io_context again until the operation completes. - io_context_.run(); - } - } - - static void handle_receive( - const asio::error_code& ec, std::size_t length, - asio::error_code* out_ec, std::size_t* out_length) - { - *out_ec = ec; - *out_length = length; - } - -private: - asio::io_context io_context_; - udp::socket socket_; -}; - -//---------------------------------------------------------------------- - -int main(int argc, char* argv[]) -{ - try - { - using namespace std; // For atoi. - - if (argc != 3) - { - std::cerr << "Usage: blocking_udp_client \n"; - return 1; - } - - udp::endpoint listen_endpoint( - asio::ip::make_address(argv[1]), - std::atoi(argv[2])); - - client c(listen_endpoint); - - for (;;) - { - char data[1024]; - asio::error_code ec; - std::size_t n = c.receive(asio::buffer(data), - asio::chrono::seconds(10), ec); - - if (ec) - { - std::cout << "Receive error: " << ec.message() << "\n"; - } - else - { - std::cout << "Received: "; - std::cout.write(data, n); - std::cout << "\n"; - } - } - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/timeouts/server.cpp b/asio/src/examples/cpp03/timeouts/server.cpp deleted file mode 100644 index 8dc957e260..0000000000 --- a/asio/src/examples/cpp03/timeouts/server.cpp +++ /dev/null @@ -1,433 +0,0 @@ -// -// server.cpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include "asio/buffer.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/ip/udp.hpp" -#include "asio/read_until.hpp" -#include "asio/steady_timer.hpp" -#include "asio/write.hpp" - -using asio::steady_timer; -using asio::ip::tcp; -using asio::ip::udp; - -//---------------------------------------------------------------------- - -class subscriber -{ -public: - virtual ~subscriber() {} - virtual void deliver(const std::string& msg) = 0; -}; - -typedef boost::shared_ptr subscriber_ptr; - -//---------------------------------------------------------------------- - -class channel -{ -public: - void join(subscriber_ptr subscriber) - { - subscribers_.insert(subscriber); - } - - void leave(subscriber_ptr subscriber) - { - subscribers_.erase(subscriber); - } - - void deliver(const std::string& msg) - { - std::for_each(subscribers_.begin(), subscribers_.end(), - boost::bind(&subscriber::deliver, - boost::placeholders::_1, boost::ref(msg))); - } - -private: - std::set subscribers_; -}; - -//---------------------------------------------------------------------- - -// -// This class manages socket timeouts by applying the concept of a deadline. -// Some asynchronous operations are given deadlines by which they must complete. -// Deadlines are enforced by two "actors" that persist for the lifetime of the -// session object, one for input and one for output: -// -// +----------------+ +----------------+ -// | | | | -// | check_deadline |<---+ | check_deadline |<---+ -// | | | async_wait() | | | async_wait() -// +----------------+ | on input +----------------+ | on output -// | | deadline | | deadline -// +---------+ +---------+ -// -// If either deadline actor determines that the corresponding deadline has -// expired, the socket is closed and any outstanding operations are cancelled. -// -// The input actor reads messages from the socket, where messages are delimited -// by the newline character: -// -// +------------+ -// | | -// | start_read |<---+ -// | | | -// +------------+ | -// | | -// async_- | +-------------+ -// read_- | | | -// until() +--->| handle_read | -// | | -// +-------------+ -// -// The deadline for receiving a complete message is 30 seconds. If a non-empty -// message is received, it is delivered to all subscribers. If a heartbeat (a -// message that consists of a single newline character) is received, a heartbeat -// is enqueued for the client, provided there are no other messages waiting to -// be sent. -// -// The output actor is responsible for sending messages to the client: -// -// +--------------+ -// | |<---------------------+ -// | await_output | | -// | |<---+ | -// +--------------+ | | -// | | | async_wait() | -// | +--------+ | -// V | -// +-------------+ +--------------+ -// | | async_write() | | -// | start_write |-------------->| handle_write | -// | | | | -// +-------------+ +--------------+ -// -// The output actor first waits for an output message to be enqueued. It does -// this by using a steady_timer as an asynchronous condition variable. The -// steady_timer will be signalled whenever the output queue is non-empty. -// -// Once a message is available, it is sent to the client. The deadline for -// sending a complete message is 30 seconds. After the message is successfully -// sent, the output actor again waits for the output queue to become non-empty. -// -class tcp_session - : public subscriber, - public boost::enable_shared_from_this -{ -public: - tcp_session(asio::io_context& io_context, channel& ch) - : channel_(ch), - socket_(io_context), - input_deadline_(io_context), - non_empty_output_queue_(io_context), - output_deadline_(io_context) - { - input_deadline_.expires_at(steady_timer::time_point::max()); - output_deadline_.expires_at(steady_timer::time_point::max()); - - // The non_empty_output_queue_ steady_timer is set to the maximum time - // point whenever the output queue is empty. This ensures that the output - // actor stays asleep until a message is put into the queue. - non_empty_output_queue_.expires_at(steady_timer::time_point::max()); - } - - tcp::socket& socket() - { - return socket_; - } - - // Called by the server object to initiate the four actors. - void start() - { - channel_.join(shared_from_this()); - - start_read(); - - input_deadline_.async_wait( - boost::bind(&tcp_session::check_deadline, - shared_from_this(), &input_deadline_)); - - await_output(); - - output_deadline_.async_wait( - boost::bind(&tcp_session::check_deadline, - shared_from_this(), &output_deadline_)); - } - -private: - void stop() - { - channel_.leave(shared_from_this()); - - asio::error_code ignored_ec; - socket_.close(ignored_ec); - input_deadline_.cancel(); - non_empty_output_queue_.cancel(); - output_deadline_.cancel(); - } - - bool stopped() const - { - return !socket_.is_open(); - } - - void deliver(const std::string& msg) - { - output_queue_.push_back(msg + "\n"); - - // Signal that the output queue contains messages. Modifying the expiry - // will wake the output actor, if it is waiting on the timer. - non_empty_output_queue_.expires_at(steady_timer::time_point::min()); - } - - void start_read() - { - // Set a deadline for the read operation. - input_deadline_.expires_after(asio::chrono::seconds(30)); - - // Start an asynchronous operation to read a newline-delimited message. - asio::async_read_until(socket_, - asio::dynamic_buffer(input_buffer_), '\n', - boost::bind(&tcp_session::handle_read, shared_from_this(), - boost::placeholders::_1, boost::placeholders::_2)); - } - - void handle_read(const asio::error_code& ec, std::size_t n) - { - if (stopped()) - return; - - if (!ec) - { - // Extract the newline-delimited message from the buffer. - std::string msg(input_buffer_.substr(0, n - 1)); - input_buffer_.erase(0, n); - - if (!msg.empty()) - { - channel_.deliver(msg); - } - else - { - // We received a heartbeat message from the client. If there's nothing - // else being sent or ready to be sent, send a heartbeat right back. - if (output_queue_.empty()) - { - output_queue_.push_back("\n"); - - // Signal that the output queue contains messages. Modifying the - // expiry will wake the output actor, if it is waiting on the timer. - non_empty_output_queue_.expires_at(steady_timer::time_point::min()); - } - } - - start_read(); - } - else - { - stop(); - } - } - - void await_output() - { - if (stopped()) - return; - - if (output_queue_.empty()) - { - // There are no messages that are ready to be sent. The actor goes to - // sleep by waiting on the non_empty_output_queue_ timer. When a new - // message is added, the timer will be modified and the actor will wake. - non_empty_output_queue_.expires_at(steady_timer::time_point::max()); - non_empty_output_queue_.async_wait( - boost::bind(&tcp_session::await_output, shared_from_this())); - } - else - { - start_write(); - } - } - - void start_write() - { - // Set a deadline for the write operation. - output_deadline_.expires_after(asio::chrono::seconds(30)); - - // Start an asynchronous operation to send a message. - asio::async_write(socket_, - asio::buffer(output_queue_.front()), - boost::bind(&tcp_session::handle_write, - shared_from_this(), boost::placeholders::_1)); - } - - void handle_write(const asio::error_code& ec) - { - if (stopped()) - return; - - if (!ec) - { - output_queue_.pop_front(); - - await_output(); - } - else - { - stop(); - } - } - - void check_deadline(steady_timer* deadline) - { - if (stopped()) - return; - - // Check whether the deadline has passed. We compare the deadline against - // the current time since a new asynchronous operation may have moved the - // deadline before this actor had a chance to run. - if (deadline->expiry() <= steady_timer::clock_type::now()) - { - // The deadline has passed. Stop the session. The other actors will - // terminate as soon as possible. - stop(); - } - else - { - // Put the actor back to sleep. - deadline->async_wait( - boost::bind(&tcp_session::check_deadline, - shared_from_this(), deadline)); - } - } - - channel& channel_; - tcp::socket socket_; - std::string input_buffer_; - steady_timer input_deadline_; - std::deque output_queue_; - steady_timer non_empty_output_queue_; - steady_timer output_deadline_; -}; - -typedef boost::shared_ptr tcp_session_ptr; - -//---------------------------------------------------------------------- - -class udp_broadcaster - : public subscriber -{ -public: - udp_broadcaster(asio::io_context& io_context, - const udp::endpoint& broadcast_endpoint) - : socket_(io_context) - { - socket_.connect(broadcast_endpoint); - socket_.set_option(udp::socket::broadcast(true)); - } - -private: - void deliver(const std::string& msg) - { - asio::error_code ignored_ec; - socket_.send(asio::buffer(msg), 0, ignored_ec); - } - - udp::socket socket_; -}; - -//---------------------------------------------------------------------- - -class server -{ -public: - server(asio::io_context& io_context, - const tcp::endpoint& listen_endpoint, - const udp::endpoint& broadcast_endpoint) - : io_context_(io_context), - acceptor_(io_context, listen_endpoint) - { - subscriber_ptr bc(new udp_broadcaster(io_context_, broadcast_endpoint)); - channel_.join(bc); - - start_accept(); - } - - void start_accept() - { - tcp_session_ptr new_session(new tcp_session(io_context_, channel_)); - - acceptor_.async_accept(new_session->socket(), - boost::bind(&server::handle_accept, - this, new_session, boost::placeholders::_1)); - } - - void handle_accept(tcp_session_ptr session, - const asio::error_code& ec) - { - if (!ec) - { - session->start(); - } - - start_accept(); - } - -private: - asio::io_context& io_context_; - tcp::acceptor acceptor_; - channel channel_; -}; - -//---------------------------------------------------------------------- - -int main(int argc, char* argv[]) -{ - try - { - using namespace std; // For atoi. - - if (argc != 4) - { - std::cerr << "Usage: server \n"; - return 1; - } - - asio::io_context io_context; - - tcp::endpoint listen_endpoint(tcp::v4(), atoi(argv[1])); - - udp::endpoint broadcast_endpoint( - asio::ip::make_address(argv[2]), atoi(argv[3])); - - server s(io_context, listen_endpoint, broadcast_endpoint); - - io_context.run(); - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/timers/.gitignore b/asio/src/examples/cpp03/timers/.gitignore deleted file mode 100644 index a3fe695226..0000000000 --- a/asio/src/examples/cpp03/timers/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -*timer -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp03/timers/time_t_timer.cpp b/asio/src/examples/cpp03/timers/time_t_timer.cpp deleted file mode 100644 index c760623d0c..0000000000 --- a/asio/src/examples/cpp03/timers/time_t_timer.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// -// time_t_timer.cpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the 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 -#include -#include - -// A custom implementation of the Clock concept from the standard C++ library. -struct time_t_clock -{ - // The duration type. - typedef asio::chrono::steady_clock::duration duration; - - // The duration's underlying arithmetic representation. - typedef duration::rep rep; - - // The ratio representing the duration's tick period. - typedef duration::period period; - - // An absolute time point represented using the clock. - typedef asio::chrono::time_point time_point; - - // The clock is not monotonically increasing. - static const bool is_steady = false; - - // Get the current time. - static time_point now() - { - return time_point() + asio::chrono::seconds(std::time(0)); - } -}; - -// The asio::basic_waitable_timer template accepts an optional WaitTraits -// template parameter. The underlying time_t clock has one-second granularity, -// so these traits may be customised to reduce the latency between the clock -// ticking over and a wait operation's completion. When the timeout is near -// (less than one second away) we poll the clock more frequently to detect the -// time change closer to when it occurs. The user can select the appropriate -// trade off between accuracy and the increased CPU cost of polling. In extreme -// cases, a zero duration may be returned to make the timers as accurate as -// possible, albeit with 100% CPU usage. -struct time_t_wait_traits -{ - // Determine how long until the clock should be next polled to determine - // whether the duration has elapsed. - static time_t_clock::duration to_wait_duration( - const time_t_clock::duration& d) - { - if (d > asio::chrono::seconds(1)) - return d - asio::chrono::seconds(1); - else if (d > asio::chrono::seconds(0)) - return asio::chrono::milliseconds(10); - else - return asio::chrono::seconds(0); - } - - // Determine how long until the clock should be next polled to determine - // whether the absoluate time has been reached. - static time_t_clock::duration to_wait_duration( - const time_t_clock::time_point& t) - { - return to_wait_duration(t - time_t_clock::now()); - } -}; - -typedef asio::basic_waitable_timer< - time_t_clock, time_t_wait_traits> time_t_timer; - -void handle_timeout(const asio::error_code&) -{ - std::cout << "handle_timeout\n"; -} - -int main() -{ - try - { - asio::io_context io_context; - - time_t_timer timer(io_context); - - timer.expires_after(asio::chrono::seconds(5)); - std::cout << "Starting synchronous wait\n"; - timer.wait(); - std::cout << "Finished synchronous wait\n"; - - timer.expires_after(asio::chrono::seconds(5)); - std::cout << "Starting asynchronous wait\n"; - timer.async_wait(&handle_timeout); - io_context.run(); - std::cout << "Finished asynchronous wait\n"; - } - catch (std::exception& e) - { - std::cout << "Exception: " << e.what() << "\n"; - } - - return 0; -} diff --git a/asio/src/examples/cpp03/windows/.gitignore b/asio/src/examples/cpp03/windows/.gitignore deleted file mode 100644 index 180ba886e5..0000000000 --- a/asio/src/examples/cpp03/windows/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -.dirstamp -*.o -*.obj -*.exe -server -*.ilk -*.manifest -*.pdb -*.tds diff --git a/asio/src/examples/cpp11/Makefile.am b/asio/src/examples/cpp11/Makefile.am index d31ce02c7e..a132a469ff 100644 --- a/asio/src/examples/cpp11/Makefile.am +++ b/asio/src/examples/cpp11/Makefile.am @@ -32,8 +32,16 @@ noinst_PROGRAMS = \ files/async_file_copy \ futures/daytime_client \ handler_tracking/async_tcp_echo_server \ + http/client/async_client \ + http/client/sync_client \ http/server/http_server \ + http/server2/http_server \ + http/server3/http_server \ + http/server4/http_server \ + icmp/ping \ invocation/prioritised_handlers \ + iostreams/daytime_client \ + iostreams/daytime_server \ iostreams/http_client \ multicast/receiver \ multicast/sender \ @@ -51,6 +59,9 @@ noinst_PROGRAMS = \ parallel_group/wait_for_one \ parallel_group/wait_for_one_error \ parallel_group/wait_for_one_success \ + porthopper/client \ + porthopper/server \ + services/daytime_client \ socks4/sync_client \ timeouts/async_tcp_client \ timeouts/blocking_tcp_client \ @@ -58,10 +69,23 @@ noinst_PROGRAMS = \ timeouts/blocking_udp_client \ timeouts/server \ timers/time_t_timer \ + tutorial/timer1/timer \ + tutorial/timer2/timer \ + tutorial/timer3/timer \ + tutorial/timer4/timer \ + tutorial/timer5/timer \ + tutorial/daytime1/client \ + tutorial/daytime2/server \ + tutorial/daytime3/server \ + tutorial/daytime4/client \ + tutorial/daytime5/server \ + tutorial/daytime6/server \ + tutorial/daytime7/server \ type_erasure/type_erasure if !WINDOWS_TARGET noinst_PROGRAMS += \ + chat/posix_chat_client \ fork/daemon \ fork/process_per_connection \ local/connect_pair \ @@ -72,6 +96,11 @@ noinst_PROGRAMS += \ local/fd_passing_stream_client endif +if WINDOWS_TARGET +noinst_PROGRAMS += \ + windows/transmit_file +endif + if HAVE_OPENSSL noinst_PROGRAMS += \ ssl/client \ @@ -85,8 +114,51 @@ noinst_PROGRAMS += \ endif noinst_HEADERS = \ + chat/chat_message.hpp \ + handler_tracking/custom_tracking.hpp \ + http/server/connection.hpp \ + http/server/connection_manager.hpp \ + http/server/header.hpp \ + http/server/mime_types.hpp \ + http/server/reply.hpp \ + http/server/request.hpp \ + http/server/request_handler.hpp \ + http/server/request_parser.hpp \ + http/server/server.hpp \ + http/server2/connection.hpp \ + http/server2/io_context_pool.hpp \ + http/server2/header.hpp \ + http/server2/mime_types.hpp \ + http/server2/reply.hpp \ + http/server2/request.hpp \ + http/server2/request_handler.hpp \ + http/server2/request_parser.hpp \ + http/server2/server.hpp \ + http/server3/connection.hpp \ + http/server3/header.hpp \ + http/server3/mime_types.hpp \ + http/server3/reply.hpp \ + http/server3/request.hpp \ + http/server3/request_handler.hpp \ + http/server3/request_parser.hpp \ + http/server3/server.hpp \ + http/server4/file_handler.hpp \ + http/server4/header.hpp \ + http/server4/mime_types.hpp \ + http/server4/reply.hpp \ + http/server4/request.hpp \ + http/server4/request_parser.hpp \ + http/server4/server.hpp \ + icmp/icmp_header.hpp \ + icmp/ipv4_header.hpp \ + porthopper/protocol.hpp \ + services/basic_logger.hpp \ + services/logger.hpp \ + services/logger_service.hpp \ socks4/socks4.hpp \ - chat/chat_message.hpp + type_erasure/line_reader.hpp \ + type_erasure/stdin_line_reader.hpp \ + type_erasure/sleep.hpp AM_CXXFLAGS = -I$(srcdir)/../../../include @@ -112,6 +184,8 @@ files_blocking_file_copy_SOURCES = files/blocking_file_copy.cpp files_async_file_copy_SOURCES = files/async_file_copy.cpp futures_daytime_client_SOURCES = futures/daytime_client.cpp handler_tracking_async_tcp_echo_server_SOURCES = handler_tracking/async_tcp_echo_server.cpp +http_client_async_client_SOURCES = http/client/async_client.cpp +http_client_sync_client_SOURCES = http/client/sync_client.cpp http_server_http_server_SOURCES = \ http/server/connection.cpp \ http/server/connection_manager.cpp \ @@ -121,7 +195,34 @@ http_server_http_server_SOURCES = \ http/server/request_handler.cpp \ http/server/request_parser.cpp \ http/server/server.cpp +http_server2_http_server_SOURCES = \ + http/server2/connection.cpp \ + http/server2/io_context_pool.cpp \ + http/server2/main.cpp \ + http/server2/mime_types.cpp \ + http/server2/reply.cpp \ + http/server2/request_handler.cpp \ + http/server2/request_parser.cpp \ + http/server2/server.cpp +http_server3_http_server_SOURCES = \ + http/server3/connection.cpp \ + http/server3/main.cpp \ + http/server3/mime_types.cpp \ + http/server3/reply.cpp \ + http/server3/request_handler.cpp \ + http/server3/request_parser.cpp \ + http/server3/server.cpp +http_server4_http_server_SOURCES = \ + http/server4/file_handler.cpp \ + http/server4/main.cpp \ + http/server4/mime_types.cpp \ + http/server4/reply.cpp \ + http/server4/request_parser.cpp \ + http/server4/server.cpp +icmp_ping_SOURCES = icmp/ping.cpp invocation_prioritised_handlers_SOURCES = invocation/prioritised_handlers.cpp +iostreams_daytime_client_SOURCES = iostreams/daytime_client.cpp +iostreams_daytime_server_SOURCES = iostreams/daytime_server.cpp iostreams_http_client_SOURCES = iostreams/http_client.cpp multicast_receiver_SOURCES = multicast/receiver.cpp multicast_sender_SOURCES = multicast/sender.cpp @@ -139,6 +240,11 @@ parallel_group_wait_for_all_SOURCES = parallel_group/wait_for_all.cpp parallel_group_wait_for_one_SOURCES = parallel_group/wait_for_one.cpp parallel_group_wait_for_one_error_SOURCES = parallel_group/wait_for_one_error.cpp parallel_group_wait_for_one_success_SOURCES = parallel_group/wait_for_one_success.cpp +porthopper_client_SOURCES = porthopper/client.cpp +porthopper_server_SOURCES = porthopper/server.cpp +services_daytime_client_SOURCES = \ + services/daytime_client.cpp \ + services/logger_service.cpp socks4_sync_client_SOURCES = socks4/sync_client.cpp timeouts_async_tcp_client_SOURCES = timeouts/async_tcp_client.cpp timeouts_blocking_tcp_client_SOURCES = timeouts/blocking_tcp_client.cpp @@ -146,9 +252,22 @@ timeouts_blocking_token_tcp_client_SOURCES = timeouts/blocking_token_tcp_client. timeouts_blocking_udp_client_SOURCES = timeouts/blocking_udp_client.cpp timeouts_server_SOURCES = timeouts/server.cpp timers_time_t_timer_SOURCES = timers/time_t_timer.cpp +tutorial_timer1_timer_SOURCES = tutorial/timer1/timer.cpp +tutorial_timer2_timer_SOURCES = tutorial/timer2/timer.cpp +tutorial_timer3_timer_SOURCES = tutorial/timer3/timer.cpp +tutorial_timer4_timer_SOURCES = tutorial/timer4/timer.cpp +tutorial_timer5_timer_SOURCES = tutorial/timer5/timer.cpp +tutorial_daytime1_client_SOURCES = tutorial/daytime1/client.cpp +tutorial_daytime2_server_SOURCES = tutorial/daytime2/server.cpp +tutorial_daytime3_server_SOURCES = tutorial/daytime3/server.cpp +tutorial_daytime4_client_SOURCES = tutorial/daytime4/client.cpp +tutorial_daytime5_server_SOURCES = tutorial/daytime5/server.cpp +tutorial_daytime6_server_SOURCES = tutorial/daytime6/server.cpp +tutorial_daytime7_server_SOURCES = tutorial/daytime7/server.cpp type_erasure_type_erasure_SOURCES = type_erasure/main.cpp type_erasure/stdin_line_reader.cpp type_erasure/sleep.cpp if !WINDOWS_TARGET +chat_posix_chat_client_SOURCES = chat/posix_chat_client.cpp fork_daemon_SOURCES = fork/daemon.cpp fork_process_per_connection_SOURCES = fork/process_per_connection.cpp local_connect_pair_SOURCES = local/connect_pair.cpp @@ -159,6 +278,10 @@ local_fd_passing_stream_server_SOURCES = local/fd_passing_stream_server.cpp local_fd_passing_stream_client_SOURCES = local/fd_passing_stream_client.cpp endif +if WINDOWS_TARGET +windows_transmit_file_SOURCES = windows/transmit_file.cpp +endif + if HAVE_OPENSSL ssl_client_SOURCES = ssl/client.cpp ssl_server_SOURCES = ssl/server.cpp @@ -172,24 +295,14 @@ spawn_parallel_grep_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_t endif EXTRA_DIST = \ - handler_tracking/custom_tracking.hpp \ - http/server/connection.hpp \ - http/server/connection_manager.hpp \ - http/server/header.hpp \ - http/server/mime_types.hpp \ - http/server/reply.hpp \ - http/server/request.hpp \ - http/server/request_handler.hpp \ - http/server/request_parser.hpp \ - http/server/server.hpp \ + serialization/client.cpp \ + serialization/server.cpp \ + serialization/connection.hpp \ + serialization/stock.hpp \ ssl/README \ ssl/ca.pem \ ssl/server.pem \ - ssl/dh4096.pem \ - type_erasure/line_reader.hpp \ - type_erasure/stdin_line_reader.hpp \ - type_erasure/sleep.hpp - + ssl/dh4096.pem MAINTAINERCLEANFILES = \ $(srcdir)/Makefile.in diff --git a/asio/src/examples/cpp11/chat/posix_chat_client.cpp b/asio/src/examples/cpp11/chat/posix_chat_client.cpp new file mode 100644 index 0000000000..433caa289a --- /dev/null +++ b/asio/src/examples/cpp11/chat/posix_chat_client.cpp @@ -0,0 +1,198 @@ +// +// posix_chat_client.cpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the 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 +#include +#include +#include +#include "asio.hpp" +#include "chat_message.hpp" + +#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) + +using asio::ip::tcp; +namespace posix = asio::posix; + +class posix_chat_client +{ +public: + posix_chat_client(asio::io_context& io_context, + const tcp::resolver::results_type& endpoints) + : socket_(io_context), + input_(io_context, ::dup(STDIN_FILENO)), + output_(io_context, ::dup(STDOUT_FILENO)), + input_buffer_(chat_message::max_body_length) + { + do_connect(endpoints); + } + +private: + void do_connect(const tcp::resolver::results_type& endpoints) + { + asio::async_connect(socket_, endpoints, + [this](std::error_code ec, tcp::endpoint) + { + if (!ec) + { + do_read_header(); + do_read_input(); + } + }); + } + + void do_read_header() + { + asio::async_read(socket_, + asio::buffer(read_msg_.data(), chat_message::header_length), + [this](std::error_code ec, std::size_t /*length*/) + { + if (!ec && read_msg_.decode_header()) + { + do_read_body(); + } + else + { + close(); + } + }); + } + + void do_read_body() + { + asio::async_read(socket_, + asio::buffer(read_msg_.body(), read_msg_.body_length()), + [this](std::error_code ec, std::size_t /*length*/) + { + if (!ec) + { + do_write_output(); + } + else + { + close(); + } + }); + } + + void do_write_output() + { + // Write out the message we just received, terminated by a newline. + static char eol[] = { '\n' }; + std::array buffers = {{ + asio::buffer(read_msg_.body(), read_msg_.body_length()), + asio::buffer(eol) }}; + asio::async_write(output_, buffers, + [this](std::error_code ec, std::size_t /*length*/) + { + if (!ec) + { + do_read_header(); + } + else + { + close(); + } + }); + } + + void do_read_input() + { + // Read a line of input entered by the user. + asio::async_read_until(input_, input_buffer_, '\n', + [this](std::error_code ec, std::size_t length) + { + if (!ec) + { + // Write the message (minus the newline) to the server. + write_msg_.body_length(length - 1); + input_buffer_.sgetn(write_msg_.body(), length - 1); + input_buffer_.consume(1); // Remove newline from input. + write_msg_.encode_header(); + do_write_message(); + } + else if (ec == asio::error::not_found) + { + // Didn't get a newline. Send whatever we have. + write_msg_.body_length(input_buffer_.size()); + input_buffer_.sgetn(write_msg_.body(), input_buffer_.size()); + write_msg_.encode_header(); + do_write_message(); + } + else + { + close(); + } + }); + } + + void do_write_message() + { + asio::async_write(socket_, + asio::buffer(write_msg_.data(), write_msg_.length()), + [this](std::error_code ec, std::size_t /*length*/) + { + if (!ec) + { + do_read_input(); + } + else + { + close(); + } + }); + } + + void close() + { + // Cancel all outstanding asynchronous operations. + socket_.close(); + input_.close(); + output_.close(); + } + +private: + tcp::socket socket_; + posix::stream_descriptor input_; + posix::stream_descriptor output_; + chat_message read_msg_; + chat_message write_msg_; + asio::streambuf input_buffer_; +}; + +int main(int argc, char* argv[]) +{ + try + { + if (argc != 3) + { + std::cerr << "Usage: posix_chat_client \n"; + return 1; + } + + asio::io_context io_context; + + tcp::resolver resolver(io_context); + tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]); + + posix_chat_client c(io_context, endpoints); + + io_context.run(); + } + catch (std::exception& e) + { + std::cerr << "Exception: " << e.what() << "\n"; + } + + return 0; +} + +#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) +int main() {} +#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) diff --git a/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp b/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp index a319da25a2..32fa914dfc 100644 --- a/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp +++ b/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp @@ -26,12 +26,12 @@ void session(tcp::socket sock) { char data[max_length]; - asio::error_code error; + std::error_code error; size_t length = sock.read_some(asio::buffer(data), error); if (error == asio::error::eof) break; // Connection closed cleanly by peer. else if (error) - throw asio::system_error(error); // Some other error. + throw std::system_error(error); // Some other error. asio::write(sock, asio::buffer(data, length)); } diff --git a/asio/src/examples/cpp11/files/blocking_file_copy.cpp b/asio/src/examples/cpp11/files/blocking_file_copy.cpp index 50e2cd41e1..f55a7880ce 100644 --- a/asio/src/examples/cpp11/files/blocking_file_copy.cpp +++ b/asio/src/examples/cpp11/files/blocking_file_copy.cpp @@ -34,7 +34,7 @@ int main(int argc, char* argv[]) | asio::stream_file::truncate); char data[4096]; - asio::error_code error; + std::error_code error; for (;;) { std::size_t n = from_file.read_some(asio::buffer(data), error); diff --git a/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp b/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp index c9114db202..84e0d43fb6 100644 --- a/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp +++ b/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp @@ -187,7 +187,7 @@ struct custom_tracking // Record a reactor-based operation that is associated with a handler. static void reactor_operation(const tracked_handler& h, - const char* op_name, const asio::error_code& ec) + const char* op_name, const std::error_code& ec) { std::printf( "Performed operation %s.%s for native_handle = %" PRIuMAX @@ -197,7 +197,7 @@ struct custom_tracking // Record a reactor-based operation that is associated with a handler. static void reactor_operation(const tracked_handler& h, - const char* op_name, const asio::error_code& ec, + const char* op_name, const std::error_code& ec, std::size_t bytes_transferred) { std::printf( diff --git a/asio/src/examples/cpp03/http/client/.gitignore b/asio/src/examples/cpp11/http/client/.gitignore similarity index 100% rename from asio/src/examples/cpp03/http/client/.gitignore rename to asio/src/examples/cpp11/http/client/.gitignore diff --git a/asio/src/examples/cpp03/http/client/async_client.cpp b/asio/src/examples/cpp11/http/client/async_client.cpp similarity index 86% rename from asio/src/examples/cpp03/http/client/async_client.cpp rename to asio/src/examples/cpp11/http/client/async_client.cpp index e9116fd26a..d1e4768f40 100644 --- a/asio/src/examples/cpp03/http/client/async_client.cpp +++ b/asio/src/examples/cpp11/http/client/async_client.cpp @@ -8,12 +8,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include #include #include #include #include -#include using asio::ip::tcp; @@ -37,13 +37,13 @@ class client // Start an asynchronous resolve to translate the server and service names // into a list of endpoints. resolver_.async_resolve(server, "http", - boost::bind(&client::handle_resolve, this, + std::bind(&client::handle_resolve, this, asio::placeholders::error, asio::placeholders::results)); } private: - void handle_resolve(const asio::error_code& err, + void handle_resolve(const std::error_code& err, const tcp::resolver::results_type& endpoints) { if (!err) @@ -51,7 +51,7 @@ class client // Attempt a connection to each endpoint in the list until we // successfully establish a connection. asio::async_connect(socket_, endpoints, - boost::bind(&client::handle_connect, this, + std::bind(&client::handle_connect, this, asio::placeholders::error)); } else @@ -60,13 +60,13 @@ class client } } - void handle_connect(const asio::error_code& err) + void handle_connect(const std::error_code& err) { if (!err) { // The connection was successful. Send the request. asio::async_write(socket_, request_, - boost::bind(&client::handle_write_request, this, + std::bind(&client::handle_write_request, this, asio::placeholders::error)); } else @@ -75,7 +75,7 @@ class client } } - void handle_write_request(const asio::error_code& err) + void handle_write_request(const std::error_code& err) { if (!err) { @@ -83,7 +83,7 @@ class client // automatically grow to accommodate the entire line. The growth may be // limited by passing a maximum size to the streambuf constructor. asio::async_read_until(socket_, response_, "\r\n", - boost::bind(&client::handle_read_status_line, this, + std::bind(&client::handle_read_status_line, this, asio::placeholders::error)); } else @@ -92,7 +92,7 @@ class client } } - void handle_read_status_line(const asio::error_code& err) + void handle_read_status_line(const std::error_code& err) { if (!err) { @@ -118,7 +118,7 @@ class client // Read the response headers, which are terminated by a blank line. asio::async_read_until(socket_, response_, "\r\n\r\n", - boost::bind(&client::handle_read_headers, this, + std::bind(&client::handle_read_headers, this, asio::placeholders::error)); } else @@ -127,7 +127,7 @@ class client } } - void handle_read_headers(const asio::error_code& err) + void handle_read_headers(const std::error_code& err) { if (!err) { @@ -145,7 +145,7 @@ class client // Start reading remaining data until EOF. asio::async_read(socket_, response_, asio::transfer_at_least(1), - boost::bind(&client::handle_read_content, this, + std::bind(&client::handle_read_content, this, asio::placeholders::error)); } else @@ -154,7 +154,7 @@ class client } } - void handle_read_content(const asio::error_code& err) + void handle_read_content(const std::error_code& err) { if (!err) { @@ -164,7 +164,7 @@ class client // Continue reading remaining data until EOF. asio::async_read(socket_, response_, asio::transfer_at_least(1), - boost::bind(&client::handle_read_content, this, + std::bind(&client::handle_read_content, this, asio::placeholders::error)); } else if (err != asio::error::eof) diff --git a/asio/src/examples/cpp03/http/client/sync_client.cpp b/asio/src/examples/cpp11/http/client/sync_client.cpp similarity index 97% rename from asio/src/examples/cpp03/http/client/sync_client.cpp rename to asio/src/examples/cpp11/http/client/sync_client.cpp index d0ac47ddca..9166babd64 100644 --- a/asio/src/examples/cpp03/http/client/sync_client.cpp +++ b/asio/src/examples/cpp11/http/client/sync_client.cpp @@ -90,12 +90,12 @@ int main(int argc, char* argv[]) std::cout << &response; // Read until EOF, writing data to output as we go. - asio::error_code error; + std::error_code error; while (asio::read(socket, response, asio::transfer_at_least(1), error)) std::cout << &response; if (error != asio::error::eof) - throw asio::system_error(error); + throw std::system_error(error); } catch (std::exception& e) { diff --git a/asio/src/examples/cpp03/http/doc_root/data_1K.html b/asio/src/examples/cpp11/http/doc_root/data_1K.html similarity index 100% rename from asio/src/examples/cpp03/http/doc_root/data_1K.html rename to asio/src/examples/cpp11/http/doc_root/data_1K.html diff --git a/asio/src/examples/cpp03/http/doc_root/data_2K.html b/asio/src/examples/cpp11/http/doc_root/data_2K.html similarity index 100% rename from asio/src/examples/cpp03/http/doc_root/data_2K.html rename to asio/src/examples/cpp11/http/doc_root/data_2K.html diff --git a/asio/src/examples/cpp03/http/doc_root/data_4K.html b/asio/src/examples/cpp11/http/doc_root/data_4K.html similarity index 100% rename from asio/src/examples/cpp03/http/doc_root/data_4K.html rename to asio/src/examples/cpp11/http/doc_root/data_4K.html diff --git a/asio/src/examples/cpp03/http/doc_root/data_8K.html b/asio/src/examples/cpp11/http/doc_root/data_8K.html similarity index 100% rename from asio/src/examples/cpp03/http/doc_root/data_8K.html rename to asio/src/examples/cpp11/http/doc_root/data_8K.html diff --git a/asio/src/examples/cpp11/http/server/connection.cpp b/asio/src/examples/cpp11/http/server/connection.cpp index 82eb62a155..bc6de52bf2 100644 --- a/asio/src/examples/cpp11/http/server/connection.cpp +++ b/asio/src/examples/cpp11/http/server/connection.cpp @@ -10,7 +10,6 @@ #include "connection.hpp" #include -#include #include "connection_manager.hpp" #include "request_handler.hpp" @@ -78,7 +77,7 @@ void connection::do_write() if (!ec) { // Initiate graceful connection closure. - asio::error_code ignored_ec; + std::error_code ignored_ec; socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); } diff --git a/asio/src/examples/cpp11/http/server/connection.hpp b/asio/src/examples/cpp11/http/server/connection.hpp index dfaa4dd5f3..d8681b9224 100644 --- a/asio/src/examples/cpp11/http/server/connection.hpp +++ b/asio/src/examples/cpp11/http/server/connection.hpp @@ -11,9 +11,9 @@ #ifndef HTTP_CONNECTION_HPP #define HTTP_CONNECTION_HPP +#include #include #include -#include #include "reply.hpp" #include "request.hpp" #include "request_handler.hpp" diff --git a/asio/src/examples/cpp03/chat/.gitignore b/asio/src/examples/cpp11/http/server2/.gitignore similarity index 100% rename from asio/src/examples/cpp03/chat/.gitignore rename to asio/src/examples/cpp11/http/server2/.gitignore diff --git a/asio/src/examples/cpp11/http/server2/connection.cpp b/asio/src/examples/cpp11/http/server2/connection.cpp new file mode 100644 index 0000000000..5ca139d372 --- /dev/null +++ b/asio/src/examples/cpp11/http/server2/connection.cpp @@ -0,0 +1,89 @@ +// +// connection.cpp +// ~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the 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 "connection.hpp" +#include +#include "request_handler.hpp" + +namespace http { +namespace server2 { + +connection::connection(asio::ip::tcp::socket socket, + request_handler& handler) + : socket_(std::move(socket)), + request_handler_(handler) +{ +} + +void connection::start() +{ + do_read(); +} + +void connection::do_read() +{ + auto self(shared_from_this()); + socket_.async_read_some(asio::buffer(buffer_), + [this, self](std::error_code ec, std::size_t bytes_transferred) + { + if (!ec) + { + request_parser::result_type result; + std::tie(result, std::ignore) = request_parser_.parse( + request_, buffer_.data(), buffer_.data() + bytes_transferred); + + if (result == request_parser::good) + { + request_handler_.handle_request(request_, reply_); + do_write(); + } + else if (result == request_parser::bad) + { + reply_ = reply::stock_reply(reply::bad_request); + do_write(); + } + else + { + do_read(); + } + } + + // If an error occurs then no new asynchronous operations are + // started. This means that all shared_ptr references to the + // connection object will disappear and the object will be + // destroyed automatically after this handler returns. The + // connection class's destructor closes the socket. + }); +} + +void connection::do_write() +{ + auto self(shared_from_this()); + asio::async_write(socket_, reply_.to_buffers(), + [this, self](std::error_code ec, std::size_t) + { + if (!ec) + { + // Initiate graceful connection closure. + std::error_code ignored_ec; + socket_.shutdown(asio::ip::tcp::socket::shutdown_both, + ignored_ec); + } + + // No new asynchronous operations are started. This means that + // all shared_ptr references to the connection object will + // disappear and the object will be destroyed automatically after + // this handler returns. The connection class's destructor closes + // the socket. + }); +} + +} // namespace server2 +} // namespace http diff --git a/asio/src/examples/cpp03/http/server2/connection.hpp b/asio/src/examples/cpp11/http/server2/connection.hpp similarity index 61% rename from asio/src/examples/cpp03/http/server2/connection.hpp rename to asio/src/examples/cpp11/http/server2/connection.hpp index 4646460830..90c8597946 100644 --- a/asio/src/examples/cpp03/http/server2/connection.hpp +++ b/asio/src/examples/cpp11/http/server2/connection.hpp @@ -12,10 +12,8 @@ #define HTTP_SERVER2_CONNECTION_HPP #include -#include -#include -#include -#include +#include +#include #include "reply.hpp" #include "request.hpp" #include "request_handler.hpp" @@ -26,27 +24,25 @@ namespace server2 { /// Represents a single connection from a client. class connection - : public boost::enable_shared_from_this, - private boost::noncopyable + : public std::enable_shared_from_this { public: - /// Construct a connection with the given io_context. - explicit connection(asio::io_context& io_context, - request_handler& handler); + connection(const connection&) = delete; + connection& operator=(const connection&) = delete; - /// Get the socket associated with the connection. - asio::ip::tcp::socket& socket(); + /// Construct a connection with the given socket. + explicit connection(asio::ip::tcp::socket socket, + request_handler& handler); /// Start the first asynchronous operation for the connection. void start(); private: - /// Handle completion of a read operation. - void handle_read(const asio::error_code& e, - std::size_t bytes_transferred); + /// Perform an asynchronous read operation. + void do_read(); - /// Handle completion of a write operation. - void handle_write(const asio::error_code& e); + /// Perform an asynchronous write operation. + void do_write(); /// Socket for the connection. asio::ip::tcp::socket socket_; @@ -55,7 +51,7 @@ class connection request_handler& request_handler_; /// Buffer for incoming data. - boost::array buffer_; + std::array buffer_; /// The incoming request. request request_; @@ -67,7 +63,7 @@ class connection reply reply_; }; -typedef boost::shared_ptr connection_ptr; +typedef std::shared_ptr connection_ptr; } // namespace server2 } // namespace http diff --git a/asio/src/examples/cpp03/http/server2/header.hpp b/asio/src/examples/cpp11/http/server2/header.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server2/header.hpp rename to asio/src/examples/cpp11/http/server2/header.hpp diff --git a/asio/src/examples/cpp03/http/server2/io_context_pool.cpp b/asio/src/examples/cpp11/http/server2/io_context_pool.cpp similarity index 83% rename from asio/src/examples/cpp03/http/server2/io_context_pool.cpp rename to asio/src/examples/cpp11/http/server2/io_context_pool.cpp index 2f3592381f..895c4cc263 100644 --- a/asio/src/examples/cpp03/http/server2/io_context_pool.cpp +++ b/asio/src/examples/cpp11/http/server2/io_context_pool.cpp @@ -10,8 +10,7 @@ #include "server.hpp" #include -#include -#include +#include namespace http { namespace server2 { @@ -35,17 +34,13 @@ io_context_pool::io_context_pool(std::size_t pool_size) void io_context_pool::run() { // Create a pool of threads to run all of the io_contexts. - std::vector > threads; + std::vector threads; for (std::size_t i = 0; i < io_contexts_.size(); ++i) - { - boost::shared_ptr thread(new asio::thread( - boost::bind(&asio::io_context::run, io_contexts_[i]))); - threads.push_back(thread); - } + threads.emplace_back([this, i]{ io_contexts_[i]->run(); }); // Wait for all threads in the pool to exit. for (std::size_t i = 0; i < threads.size(); ++i) - threads[i]->join(); + threads[i].join(); } void io_context_pool::stop() diff --git a/asio/src/examples/cpp03/http/server2/io_context_pool.hpp b/asio/src/examples/cpp11/http/server2/io_context_pool.hpp similarity index 86% rename from asio/src/examples/cpp03/http/server2/io_context_pool.hpp rename to asio/src/examples/cpp11/http/server2/io_context_pool.hpp index 0f59be081c..d9473fac84 100644 --- a/asio/src/examples/cpp03/http/server2/io_context_pool.hpp +++ b/asio/src/examples/cpp11/http/server2/io_context_pool.hpp @@ -13,16 +13,14 @@ #include #include +#include #include -#include -#include namespace http { namespace server2 { /// A pool of io_context objects. class io_context_pool - : private boost::noncopyable { public: /// Construct the io_context pool. @@ -38,7 +36,10 @@ class io_context_pool asio::io_context& get_io_context(); private: - typedef boost::shared_ptr io_context_ptr; + io_context_pool(const io_context_pool&) = delete; + io_context_pool& operator=(const io_context_pool&) = delete; + + typedef std::shared_ptr io_context_ptr; typedef asio::executor_work_guard< asio::io_context::executor_type> io_context_work; diff --git a/asio/src/examples/cpp03/http/server2/main.cpp b/asio/src/examples/cpp11/http/server2/main.cpp similarity index 87% rename from asio/src/examples/cpp03/http/server2/main.cpp rename to asio/src/examples/cpp11/http/server2/main.cpp index e4788f0ab4..baa88d2a2b 100644 --- a/asio/src/examples/cpp03/http/server2/main.cpp +++ b/asio/src/examples/cpp11/http/server2/main.cpp @@ -11,8 +11,6 @@ #include #include #include -#include -#include #include "server.hpp" int main(int argc, char* argv[]) @@ -31,7 +29,7 @@ int main(int argc, char* argv[]) } // Initialise the server. - std::size_t num_threads = boost::lexical_cast(argv[3]); + std::size_t num_threads = std::stoi(argv[3]); http::server2::server s(argv[1], argv[2], argv[4], num_threads); // Run the server until stopped. diff --git a/asio/src/examples/cpp03/http/server2/mime_types.cpp b/asio/src/examples/cpp11/http/server2/mime_types.cpp similarity index 100% rename from asio/src/examples/cpp03/http/server2/mime_types.cpp rename to asio/src/examples/cpp11/http/server2/mime_types.cpp diff --git a/asio/src/examples/cpp03/http/server2/mime_types.hpp b/asio/src/examples/cpp11/http/server2/mime_types.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server2/mime_types.hpp rename to asio/src/examples/cpp11/http/server2/mime_types.hpp diff --git a/asio/src/examples/cpp03/http/server2/reply.cpp b/asio/src/examples/cpp11/http/server2/reply.cpp similarity index 98% rename from asio/src/examples/cpp03/http/server2/reply.cpp rename to asio/src/examples/cpp11/http/server2/reply.cpp index 19787c5eff..39e3b2163d 100644 --- a/asio/src/examples/cpp03/http/server2/reply.cpp +++ b/asio/src/examples/cpp11/http/server2/reply.cpp @@ -10,7 +10,6 @@ #include "reply.hpp" #include -#include namespace http { namespace server2 { @@ -246,7 +245,7 @@ reply reply::stock_reply(reply::status_type status) rep.content = stock_replies::to_string(status); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = "text/html"; return rep; diff --git a/asio/src/examples/cpp03/http/server2/reply.hpp b/asio/src/examples/cpp11/http/server2/reply.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server2/reply.hpp rename to asio/src/examples/cpp11/http/server2/reply.hpp diff --git a/asio/src/examples/cpp03/http/server2/request.hpp b/asio/src/examples/cpp11/http/server2/request.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server2/request.hpp rename to asio/src/examples/cpp11/http/server2/request.hpp diff --git a/asio/src/examples/cpp03/http/server2/request_handler.cpp b/asio/src/examples/cpp11/http/server2/request_handler.cpp similarity index 96% rename from asio/src/examples/cpp03/http/server2/request_handler.cpp rename to asio/src/examples/cpp11/http/server2/request_handler.cpp index 8fe23b54ee..db51f4a21f 100644 --- a/asio/src/examples/cpp03/http/server2/request_handler.cpp +++ b/asio/src/examples/cpp11/http/server2/request_handler.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include "mime_types.hpp" #include "reply.hpp" #include "request.hpp" @@ -74,7 +73,7 @@ void request_handler::handle_request(const request& req, reply& rep) rep.content.append(buf, is.gcount()); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = mime_types::extension_to_type(extension); } diff --git a/asio/src/examples/cpp03/http/server2/request_handler.hpp b/asio/src/examples/cpp11/http/server2/request_handler.hpp similarity index 90% rename from asio/src/examples/cpp03/http/server2/request_handler.hpp rename to asio/src/examples/cpp11/http/server2/request_handler.hpp index 88ac16628a..d9baeb7f89 100644 --- a/asio/src/examples/cpp03/http/server2/request_handler.hpp +++ b/asio/src/examples/cpp11/http/server2/request_handler.hpp @@ -12,7 +12,6 @@ #define HTTP_SERVER2_REQUEST_HANDLER_HPP #include -#include namespace http { namespace server2 { @@ -22,9 +21,11 @@ struct request; /// The common handler for all incoming requests. class request_handler - : private boost::noncopyable { public: + request_handler(const request_handler&) = delete; + request_handler& operator=(const request_handler&) = delete; + /// Construct with a directory containing files to be served. explicit request_handler(const std::string& doc_root); diff --git a/asio/src/examples/cpp03/http/server2/request_parser.cpp b/asio/src/examples/cpp11/http/server2/request_parser.cpp similarity index 75% rename from asio/src/examples/cpp03/http/server2/request_parser.cpp rename to asio/src/examples/cpp11/http/server2/request_parser.cpp index fdeb7e5c17..d27392505a 100644 --- a/asio/src/examples/cpp03/http/server2/request_parser.cpp +++ b/asio/src/examples/cpp11/http/server2/request_parser.cpp @@ -24,90 +24,90 @@ void request_parser::reset() state_ = method_start; } -boost::tribool request_parser::consume(request& req, char input) +request_parser::result_type request_parser::consume(request& req, char input) { switch (state_) { case method_start: if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { state_ = method; req.method.push_back(input); - return boost::indeterminate; + return indeterminate; } case method: if (input == ' ') { state_ = uri; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.method.push_back(input); - return boost::indeterminate; + return indeterminate; } case uri: if (input == ' ') { state_ = http_version_h; - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { req.uri.push_back(input); - return boost::indeterminate; + return indeterminate; } case http_version_h: if (input == 'H') { state_ = http_version_t_1; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_t_1: if (input == 'T') { state_ = http_version_t_2; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_t_2: if (input == 'T') { state_ = http_version_p; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_p: if (input == 'P') { state_ = http_version_slash; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_slash: if (input == '/') @@ -115,170 +115,170 @@ boost::tribool request_parser::consume(request& req, char input) req.http_version_major = 0; req.http_version_minor = 0; state_ = http_version_major_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_major_start: if (is_digit(input)) { req.http_version_major = req.http_version_major * 10 + input - '0'; state_ = http_version_major; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_major: if (input == '.') { state_ = http_version_minor_start; - return boost::indeterminate; + return indeterminate; } else if (is_digit(input)) { req.http_version_major = req.http_version_major * 10 + input - '0'; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_minor_start: if (is_digit(input)) { req.http_version_minor = req.http_version_minor * 10 + input - '0'; state_ = http_version_minor; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_minor: if (input == '\r') { state_ = expecting_newline_1; - return boost::indeterminate; + return indeterminate; } else if (is_digit(input)) { req.http_version_minor = req.http_version_minor * 10 + input - '0'; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case expecting_newline_1: if (input == '\n') { state_ = header_line_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case header_line_start: if (input == '\r') { state_ = expecting_newline_3; - return boost::indeterminate; + return indeterminate; } else if (!req.headers.empty() && (input == ' ' || input == '\t')) { state_ = header_lws; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.headers.push_back(header()); req.headers.back().name.push_back(input); state_ = header_name; - return boost::indeterminate; + return indeterminate; } case header_lws: if (input == '\r') { state_ = expecting_newline_2; - return boost::indeterminate; + return indeterminate; } else if (input == ' ' || input == '\t') { - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { state_ = header_value; req.headers.back().value.push_back(input); - return boost::indeterminate; + return indeterminate; } case header_name: if (input == ':') { state_ = space_before_header_value; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.headers.back().name.push_back(input); - return boost::indeterminate; + return indeterminate; } case space_before_header_value: if (input == ' ') { state_ = header_value; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case header_value: if (input == '\r') { state_ = expecting_newline_2; - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { req.headers.back().value.push_back(input); - return boost::indeterminate; + return indeterminate; } case expecting_newline_2: if (input == '\n') { state_ = header_line_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case expecting_newline_3: - return (input == '\n'); + return (input == '\n') ? good : bad; default: - return false; + return bad; } } diff --git a/asio/src/examples/cpp03/http/server2/request_parser.hpp b/asio/src/examples/cpp11/http/server2/request_parser.hpp similarity index 71% rename from asio/src/examples/cpp03/http/server2/request_parser.hpp rename to asio/src/examples/cpp11/http/server2/request_parser.hpp index 2d591c2e10..8bfe18cce1 100644 --- a/asio/src/examples/cpp03/http/server2/request_parser.hpp +++ b/asio/src/examples/cpp11/http/server2/request_parser.hpp @@ -11,8 +11,7 @@ #ifndef HTTP_SERVER2_REQUEST_PARSER_HPP #define HTTP_SERVER2_REQUEST_PARSER_HPP -#include -#include +#include namespace http { namespace server2 { @@ -29,27 +28,29 @@ class request_parser /// Reset to initial parser state. void reset(); - /// Parse some data. The tribool return value is true when a complete request - /// has been parsed, false if the data is invalid, indeterminate when more - /// data is required. The InputIterator return value indicates how much of the - /// input has been consumed. + /// Result of parse. + enum result_type { good, bad, indeterminate }; + + /// Parse some data. The enum return value is good when a complete request has + /// been parsed, bad if the data is invalid, indeterminate when more data is + /// required. The InputIterator return value indicates how much of the input + /// has been consumed. template - boost::tuple parse(request& req, + std::tuple parse(request& req, InputIterator begin, InputIterator end) { while (begin != end) { - boost::tribool result = consume(req, *begin++); - if (result || !result) - return boost::make_tuple(result, begin); + result_type result = consume(req, *begin++); + if (result == good || result == bad) + return std::make_tuple(result, begin); } - boost::tribool result = boost::indeterminate; - return boost::make_tuple(result, begin); + return std::make_tuple(indeterminate, begin); } private: /// Handle the next character of input. - boost::tribool consume(request& req, char input); + result_type consume(request& req, char input); /// Check if a byte is an HTTP character. static bool is_char(int c); diff --git a/asio/src/examples/cpp03/http/server2/server.cpp b/asio/src/examples/cpp11/http/server2/server.cpp similarity index 65% rename from asio/src/examples/cpp03/http/server2/server.cpp rename to asio/src/examples/cpp11/http/server2/server.cpp index f2133c8747..8dc12fb867 100644 --- a/asio/src/examples/cpp03/http/server2/server.cpp +++ b/asio/src/examples/cpp11/http/server2/server.cpp @@ -9,7 +9,9 @@ // #include "server.hpp" -#include +#include +#include +#include "connection.hpp" namespace http { namespace server2 { @@ -19,7 +21,6 @@ server::server(const std::string& address, const std::string& port, : io_context_pool_(io_context_pool_size), signals_(io_context_pool_.get_io_context()), acceptor_(io_context_pool_.get_io_context()), - new_connection_(), request_handler_(doc_root) { // Register to handle the signals that indicate when the server should exit. @@ -30,7 +31,8 @@ server::server(const std::string& address, const std::string& port, #if defined(SIGQUIT) signals_.add(SIGQUIT); #endif // defined(SIGQUIT) - signals_.async_wait(boost::bind(&server::handle_stop, this)); + + do_await_stop(); // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR). asio::ip::tcp::resolver resolver(acceptor_.get_executor()); @@ -41,7 +43,7 @@ server::server(const std::string& address, const std::string& port, acceptor_.bind(endpoint); acceptor_.listen(); - start_accept(); + do_accept(); } void server::run() @@ -49,28 +51,35 @@ void server::run() io_context_pool_.run(); } -void server::start_accept() +void server::do_accept() { - new_connection_.reset(new connection( - io_context_pool_.get_io_context(), request_handler_)); - acceptor_.async_accept(new_connection_->socket(), - boost::bind(&server::handle_accept, this, - asio::placeholders::error)); -} + acceptor_.async_accept(io_context_pool_.get_io_context(), + [this](std::error_code ec, asio::ip::tcp::socket socket) + { + // Check whether the server was stopped by a signal before this + // completion handler had a chance to run. + if (!acceptor_.is_open()) + { + return; + } -void server::handle_accept(const asio::error_code& e) -{ - if (!e) - { - new_connection_->start(); - } + if (!ec) + { + std::make_shared( + std::move(socket), request_handler_)->start(); + } - start_accept(); + do_accept(); + }); } -void server::handle_stop() +void server::do_await_stop() { - io_context_pool_.stop(); + signals_.async_wait( + [this](std::error_code /*ec*/, int /*signo*/) + { + io_context_pool_.stop(); + }); } } // namespace server2 diff --git a/asio/src/examples/cpp03/http/server2/server.hpp b/asio/src/examples/cpp11/http/server2/server.hpp similarity index 74% rename from asio/src/examples/cpp03/http/server2/server.hpp rename to asio/src/examples/cpp11/http/server2/server.hpp index 2674f19144..f647df3739 100644 --- a/asio/src/examples/cpp03/http/server2/server.hpp +++ b/asio/src/examples/cpp11/http/server2/server.hpp @@ -13,10 +13,6 @@ #include #include -#include -#include -#include -#include "connection.hpp" #include "io_context_pool.hpp" #include "request_handler.hpp" @@ -25,9 +21,11 @@ namespace server2 { /// The top-level class of the HTTP server. class server - : private boost::noncopyable { public: + server(const server&) = delete; + server& operator=(const server&) = delete; + /// Construct the server to listen on the specified TCP address and port, and /// serve up files from the given directory. explicit server(const std::string& address, const std::string& port, @@ -37,14 +35,11 @@ class server void run(); private: - /// Initiate an asynchronous accept operation. - void start_accept(); - - /// Handle completion of an asynchronous accept operation. - void handle_accept(const asio::error_code& e); + /// Perform an asynchronous accept operation. + void do_accept(); - /// Handle a request to stop the server. - void handle_stop(); + /// Wait for a request to stop the server. + void do_await_stop(); /// The pool of io_context objects used to perform asynchronous operations. io_context_pool io_context_pool_; @@ -55,9 +50,6 @@ class server /// Acceptor used to listen for incoming connections. asio::ip::tcp::acceptor acceptor_; - /// The next connection to be accepted. - connection_ptr new_connection_; - /// The handler for all incoming requests. request_handler request_handler_; }; diff --git a/asio/src/examples/cpp03/echo/.gitignore b/asio/src/examples/cpp11/http/server3/.gitignore similarity index 100% rename from asio/src/examples/cpp03/echo/.gitignore rename to asio/src/examples/cpp11/http/server3/.gitignore diff --git a/asio/src/examples/cpp11/http/server3/connection.cpp b/asio/src/examples/cpp11/http/server3/connection.cpp new file mode 100644 index 0000000000..5b48a0afb6 --- /dev/null +++ b/asio/src/examples/cpp11/http/server3/connection.cpp @@ -0,0 +1,89 @@ +// +// connection.cpp +// ~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the 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 "connection.hpp" +#include +#include "request_handler.hpp" + +namespace http { +namespace server3 { + +connection::connection(asio::ip::tcp::socket socket, + request_handler& handler) + : socket_(std::move(socket)), + request_handler_(handler) +{ +} + +void connection::start() +{ + do_read(); +} + +void connection::do_read() +{ + auto self(shared_from_this()); + socket_.async_read_some(asio::buffer(buffer_), + [this, self](std::error_code ec, std::size_t bytes_transferred) + { + if (!ec) + { + request_parser::result_type result; + std::tie(result, std::ignore) = request_parser_.parse( + request_, buffer_.data(), buffer_.data() + bytes_transferred); + + if (result == request_parser::good) + { + request_handler_.handle_request(request_, reply_); + do_write(); + } + else if (result == request_parser::bad) + { + reply_ = reply::stock_reply(reply::bad_request); + do_write(); + } + else + { + do_read(); + } + } + + // If an error occurs then no new asynchronous operations are + // started. This means that all shared_ptr references to the + // connection object will disappear and the object will be + // destroyed automatically after this handler returns. The + // connection class's destructor closes the socket. + }); +} + +void connection::do_write() +{ + auto self(shared_from_this()); + asio::async_write(socket_, reply_.to_buffers(), + [this, self](std::error_code ec, std::size_t) + { + if (!ec) + { + // Initiate graceful connection closure. + std::error_code ignored_ec; + socket_.shutdown(asio::ip::tcp::socket::shutdown_both, + ignored_ec); + } + + // No new asynchronous operations are started. This means that + // all shared_ptr references to the connection object will + // disappear and the object will be destroyed automatically after + // this handler returns. The connection class's destructor closes + // the socket. + }); +} + +} // namespace server3 +} // namespace http diff --git a/asio/src/examples/cpp03/http/server3/connection.hpp b/asio/src/examples/cpp11/http/server3/connection.hpp similarity index 57% rename from asio/src/examples/cpp03/http/server3/connection.hpp rename to asio/src/examples/cpp11/http/server3/connection.hpp index a28e9e9693..7d9c6dffab 100644 --- a/asio/src/examples/cpp03/http/server3/connection.hpp +++ b/asio/src/examples/cpp11/http/server3/connection.hpp @@ -12,10 +12,8 @@ #define HTTP_SERVER3_CONNECTION_HPP #include -#include -#include -#include -#include +#include +#include #include "reply.hpp" #include "request.hpp" #include "request_handler.hpp" @@ -26,30 +24,25 @@ namespace server3 { /// Represents a single connection from a client. class connection - : public boost::enable_shared_from_this, - private boost::noncopyable + : public std::enable_shared_from_this { public: - /// Construct a connection with the given io_context. - explicit connection(asio::io_context& io_context, - request_handler& handler); + connection(const connection&) = delete; + connection& operator=(const connection&) = delete; - /// Get the socket associated with the connection. - asio::ip::tcp::socket& socket(); + /// Construct a connection with the given socket. + explicit connection(asio::ip::tcp::socket socket, + request_handler& handler); /// Start the first asynchronous operation for the connection. void start(); private: - /// Handle completion of a read operation. - void handle_read(const asio::error_code& e, - std::size_t bytes_transferred); - - /// Handle completion of a write operation. - void handle_write(const asio::error_code& e); + /// Perform an asynchronous read operation. + void do_read(); - /// Strand to ensure the connection's handlers are not called concurrently. - asio::strand strand_; + /// Perform an asynchronous write operation. + void do_write(); /// Socket for the connection. asio::ip::tcp::socket socket_; @@ -58,7 +51,7 @@ class connection request_handler& request_handler_; /// Buffer for incoming data. - boost::array buffer_; + std::array buffer_; /// The incoming request. request request_; @@ -70,7 +63,7 @@ class connection reply reply_; }; -typedef boost::shared_ptr connection_ptr; +typedef std::shared_ptr connection_ptr; } // namespace server3 } // namespace http diff --git a/asio/src/examples/cpp03/http/server3/header.hpp b/asio/src/examples/cpp11/http/server3/header.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server3/header.hpp rename to asio/src/examples/cpp11/http/server3/header.hpp diff --git a/asio/src/examples/cpp03/http/server3/main.cpp b/asio/src/examples/cpp11/http/server3/main.cpp similarity index 87% rename from asio/src/examples/cpp03/http/server3/main.cpp rename to asio/src/examples/cpp11/http/server3/main.cpp index 3694be4164..0b945687ff 100644 --- a/asio/src/examples/cpp03/http/server3/main.cpp +++ b/asio/src/examples/cpp11/http/server3/main.cpp @@ -11,8 +11,6 @@ #include #include #include -#include -#include #include "server.hpp" int main(int argc, char* argv[]) @@ -31,7 +29,7 @@ int main(int argc, char* argv[]) } // Initialise the server. - std::size_t num_threads = boost::lexical_cast(argv[3]); + std::size_t num_threads = std::stoi(argv[3]); http::server3::server s(argv[1], argv[2], argv[4], num_threads); // Run the server until stopped. diff --git a/asio/src/examples/cpp03/http/server3/mime_types.cpp b/asio/src/examples/cpp11/http/server3/mime_types.cpp similarity index 100% rename from asio/src/examples/cpp03/http/server3/mime_types.cpp rename to asio/src/examples/cpp11/http/server3/mime_types.cpp diff --git a/asio/src/examples/cpp03/http/server3/mime_types.hpp b/asio/src/examples/cpp11/http/server3/mime_types.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server3/mime_types.hpp rename to asio/src/examples/cpp11/http/server3/mime_types.hpp diff --git a/asio/src/examples/cpp03/http/server3/reply.cpp b/asio/src/examples/cpp11/http/server3/reply.cpp similarity index 98% rename from asio/src/examples/cpp03/http/server3/reply.cpp rename to asio/src/examples/cpp11/http/server3/reply.cpp index 78ce3b6639..fbe4de33e7 100644 --- a/asio/src/examples/cpp03/http/server3/reply.cpp +++ b/asio/src/examples/cpp11/http/server3/reply.cpp @@ -10,7 +10,6 @@ #include "reply.hpp" #include -#include namespace http { namespace server3 { @@ -246,7 +245,7 @@ reply reply::stock_reply(reply::status_type status) rep.content = stock_replies::to_string(status); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = "text/html"; return rep; diff --git a/asio/src/examples/cpp03/http/server3/reply.hpp b/asio/src/examples/cpp11/http/server3/reply.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server3/reply.hpp rename to asio/src/examples/cpp11/http/server3/reply.hpp diff --git a/asio/src/examples/cpp03/http/server3/request.hpp b/asio/src/examples/cpp11/http/server3/request.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server3/request.hpp rename to asio/src/examples/cpp11/http/server3/request.hpp diff --git a/asio/src/examples/cpp03/http/server3/request_handler.cpp b/asio/src/examples/cpp11/http/server3/request_handler.cpp similarity index 96% rename from asio/src/examples/cpp03/http/server3/request_handler.cpp rename to asio/src/examples/cpp11/http/server3/request_handler.cpp index d3a482362f..6968c33b4e 100644 --- a/asio/src/examples/cpp03/http/server3/request_handler.cpp +++ b/asio/src/examples/cpp11/http/server3/request_handler.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include "mime_types.hpp" #include "reply.hpp" #include "request.hpp" @@ -74,7 +73,7 @@ void request_handler::handle_request(const request& req, reply& rep) rep.content.append(buf, is.gcount()); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = mime_types::extension_to_type(extension); } diff --git a/asio/src/examples/cpp03/http/server3/request_handler.hpp b/asio/src/examples/cpp11/http/server3/request_handler.hpp similarity index 90% rename from asio/src/examples/cpp03/http/server3/request_handler.hpp rename to asio/src/examples/cpp11/http/server3/request_handler.hpp index fbb27dcd7e..a23e1a2dd4 100644 --- a/asio/src/examples/cpp03/http/server3/request_handler.hpp +++ b/asio/src/examples/cpp11/http/server3/request_handler.hpp @@ -12,7 +12,6 @@ #define HTTP_SERVER3_REQUEST_HANDLER_HPP #include -#include namespace http { namespace server3 { @@ -22,9 +21,11 @@ struct request; /// The common handler for all incoming requests. class request_handler - : private boost::noncopyable { public: + request_handler(const request_handler&) = delete; + request_handler& operator=(const request_handler&) = delete; + /// Construct with a directory containing files to be served. explicit request_handler(const std::string& doc_root); diff --git a/asio/src/examples/cpp03/http/server3/request_parser.cpp b/asio/src/examples/cpp11/http/server3/request_parser.cpp similarity index 75% rename from asio/src/examples/cpp03/http/server3/request_parser.cpp rename to asio/src/examples/cpp11/http/server3/request_parser.cpp index e4a36aa34d..c141436eb7 100644 --- a/asio/src/examples/cpp03/http/server3/request_parser.cpp +++ b/asio/src/examples/cpp11/http/server3/request_parser.cpp @@ -24,90 +24,90 @@ void request_parser::reset() state_ = method_start; } -boost::tribool request_parser::consume(request& req, char input) +request_parser::result_type request_parser::consume(request& req, char input) { switch (state_) { case method_start: if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { state_ = method; req.method.push_back(input); - return boost::indeterminate; + return indeterminate; } case method: if (input == ' ') { state_ = uri; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.method.push_back(input); - return boost::indeterminate; + return indeterminate; } case uri: if (input == ' ') { state_ = http_version_h; - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { req.uri.push_back(input); - return boost::indeterminate; + return indeterminate; } case http_version_h: if (input == 'H') { state_ = http_version_t_1; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_t_1: if (input == 'T') { state_ = http_version_t_2; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_t_2: if (input == 'T') { state_ = http_version_p; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_p: if (input == 'P') { state_ = http_version_slash; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_slash: if (input == '/') @@ -115,170 +115,170 @@ boost::tribool request_parser::consume(request& req, char input) req.http_version_major = 0; req.http_version_minor = 0; state_ = http_version_major_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_major_start: if (is_digit(input)) { req.http_version_major = req.http_version_major * 10 + input - '0'; state_ = http_version_major; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_major: if (input == '.') { state_ = http_version_minor_start; - return boost::indeterminate; + return indeterminate; } else if (is_digit(input)) { req.http_version_major = req.http_version_major * 10 + input - '0'; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_minor_start: if (is_digit(input)) { req.http_version_minor = req.http_version_minor * 10 + input - '0'; state_ = http_version_minor; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_minor: if (input == '\r') { state_ = expecting_newline_1; - return boost::indeterminate; + return indeterminate; } else if (is_digit(input)) { req.http_version_minor = req.http_version_minor * 10 + input - '0'; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case expecting_newline_1: if (input == '\n') { state_ = header_line_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case header_line_start: if (input == '\r') { state_ = expecting_newline_3; - return boost::indeterminate; + return indeterminate; } else if (!req.headers.empty() && (input == ' ' || input == '\t')) { state_ = header_lws; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.headers.push_back(header()); req.headers.back().name.push_back(input); state_ = header_name; - return boost::indeterminate; + return indeterminate; } case header_lws: if (input == '\r') { state_ = expecting_newline_2; - return boost::indeterminate; + return indeterminate; } else if (input == ' ' || input == '\t') { - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { state_ = header_value; req.headers.back().value.push_back(input); - return boost::indeterminate; + return indeterminate; } case header_name: if (input == ':') { state_ = space_before_header_value; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.headers.back().name.push_back(input); - return boost::indeterminate; + return indeterminate; } case space_before_header_value: if (input == ' ') { state_ = header_value; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case header_value: if (input == '\r') { state_ = expecting_newline_2; - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { req.headers.back().value.push_back(input); - return boost::indeterminate; + return indeterminate; } case expecting_newline_2: if (input == '\n') { state_ = header_line_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case expecting_newline_3: - return (input == '\n'); + return (input == '\n') ? good : bad; default: - return false; + return bad; } } diff --git a/asio/src/examples/cpp03/http/server3/request_parser.hpp b/asio/src/examples/cpp11/http/server3/request_parser.hpp similarity index 71% rename from asio/src/examples/cpp03/http/server3/request_parser.hpp rename to asio/src/examples/cpp11/http/server3/request_parser.hpp index f866aff4a3..8eccdf6322 100644 --- a/asio/src/examples/cpp03/http/server3/request_parser.hpp +++ b/asio/src/examples/cpp11/http/server3/request_parser.hpp @@ -11,8 +11,7 @@ #ifndef HTTP_SERVER3_REQUEST_PARSER_HPP #define HTTP_SERVER3_REQUEST_PARSER_HPP -#include -#include +#include namespace http { namespace server3 { @@ -29,27 +28,29 @@ class request_parser /// Reset to initial parser state. void reset(); - /// Parse some data. The tribool return value is true when a complete request - /// has been parsed, false if the data is invalid, indeterminate when more - /// data is required. The InputIterator return value indicates how much of the - /// input has been consumed. + /// Result of parse. + enum result_type { good, bad, indeterminate }; + + /// Parse some data. The enum return value is good when a complete request has + /// been parsed, bad if the data is invalid, indeterminate when more data is + /// required. The InputIterator return value indicates how much of the input + /// has been consumed. template - boost::tuple parse(request& req, + std::tuple parse(request& req, InputIterator begin, InputIterator end) { while (begin != end) { - boost::tribool result = consume(req, *begin++); - if (result || !result) - return boost::make_tuple(result, begin); + result_type result = consume(req, *begin++); + if (result == good || result == bad) + return std::make_tuple(result, begin); } - boost::tribool result = boost::indeterminate; - return boost::make_tuple(result, begin); + return std::make_tuple(indeterminate, begin); } private: /// Handle the next character of input. - boost::tribool consume(request& req, char input); + result_type consume(request& req, char input); /// Check if a byte is an HTTP character. static bool is_char(int c); diff --git a/asio/src/examples/cpp03/http/server3/server.cpp b/asio/src/examples/cpp11/http/server3/server.cpp similarity index 58% rename from asio/src/examples/cpp03/http/server3/server.cpp rename to asio/src/examples/cpp11/http/server3/server.cpp index e5f48d1939..e12ce62a19 100644 --- a/asio/src/examples/cpp03/http/server3/server.cpp +++ b/asio/src/examples/cpp11/http/server3/server.cpp @@ -9,9 +9,11 @@ // #include "server.hpp" -#include -#include +#include +#include +#include #include +#include "connection.hpp" namespace http { namespace server3 { @@ -21,7 +23,6 @@ server::server(const std::string& address, const std::string& port, : thread_pool_size_(thread_pool_size), signals_(io_context_), acceptor_(io_context_), - new_connection_(), request_handler_(doc_root) { // Register to handle the signals that indicate when the server should exit. @@ -32,7 +33,8 @@ server::server(const std::string& address, const std::string& port, #if defined(SIGQUIT) signals_.add(SIGQUIT); #endif // defined(SIGQUIT) - signals_.async_wait(boost::bind(&server::handle_stop, this)); + + do_await_stop(); // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR). asio::ip::tcp::resolver resolver(io_context_); @@ -43,46 +45,52 @@ server::server(const std::string& address, const std::string& port, acceptor_.bind(endpoint); acceptor_.listen(); - start_accept(); + do_accept(); } void server::run() { - // Create a pool of threads to run all of the io_contexts. - std::vector > threads; + // Create a pool of threads to run the io_context. + std::vector threads; for (std::size_t i = 0; i < thread_pool_size_; ++i) - { - boost::shared_ptr thread(new asio::thread( - boost::bind(&asio::io_context::run, &io_context_))); - threads.push_back(thread); - } + threads.emplace_back([this]{ io_context_.run(); }); // Wait for all threads in the pool to exit. for (std::size_t i = 0; i < threads.size(); ++i) - threads[i]->join(); + threads[i].join(); } -void server::start_accept() +void server::do_accept() { - new_connection_.reset(new connection(io_context_, request_handler_)); - acceptor_.async_accept(new_connection_->socket(), - boost::bind(&server::handle_accept, this, - asio::placeholders::error)); -} + // The newly accepted socket is put into its own strand to ensure that all + // completion handlers associated with the connection do not run concurrently. + acceptor_.async_accept(asio::make_strand(io_context_), + [this](std::error_code ec, asio::ip::tcp::socket socket) + { + // Check whether the server was stopped by a signal before this + // completion handler had a chance to run. + if (!acceptor_.is_open()) + { + return; + } -void server::handle_accept(const asio::error_code& e) -{ - if (!e) - { - new_connection_->start(); - } + if (!ec) + { + std::make_shared( + std::move(socket), request_handler_)->start(); + } - start_accept(); + do_accept(); + }); } -void server::handle_stop() +void server::do_await_stop() { - io_context_.stop(); + signals_.async_wait( + [this](std::error_code /*ec*/, int /*signo*/) + { + io_context_.stop(); + }); } } // namespace server3 diff --git a/asio/src/examples/cpp03/http/server3/server.hpp b/asio/src/examples/cpp11/http/server3/server.hpp similarity index 75% rename from asio/src/examples/cpp03/http/server3/server.hpp rename to asio/src/examples/cpp11/http/server3/server.hpp index 968615c990..38c72d2591 100644 --- a/asio/src/examples/cpp03/http/server3/server.hpp +++ b/asio/src/examples/cpp11/http/server3/server.hpp @@ -13,10 +13,6 @@ #include #include -#include -#include -#include -#include "connection.hpp" #include "request_handler.hpp" namespace http { @@ -24,9 +20,11 @@ namespace server3 { /// The top-level class of the HTTP server. class server - : private boost::noncopyable { public: + server(const server&) = delete; + server& operator=(const server&) = delete; + /// Construct the server to listen on the specified TCP address and port, and /// serve up files from the given directory. explicit server(const std::string& address, const std::string& port, @@ -36,14 +34,11 @@ class server void run(); private: - /// Initiate an asynchronous accept operation. - void start_accept(); - - /// Handle completion of an asynchronous accept operation. - void handle_accept(const asio::error_code& e); + /// Perform an asynchronous accept operation. + void do_accept(); - /// Handle a request to stop the server. - void handle_stop(); + /// Wait for a request to stop the server. + void do_await_stop(); /// The number of threads that will call io_context::run(). std::size_t thread_pool_size_; @@ -57,9 +52,6 @@ class server /// Acceptor used to listen for incoming connections. asio::ip::tcp::acceptor acceptor_; - /// The next connection to be accepted. - connection_ptr new_connection_; - /// The handler for all incoming requests. request_handler request_handler_; }; diff --git a/asio/src/examples/cpp03/http/server/.gitignore b/asio/src/examples/cpp11/http/server4/.gitignore similarity index 100% rename from asio/src/examples/cpp03/http/server/.gitignore rename to asio/src/examples/cpp11/http/server4/.gitignore diff --git a/asio/src/examples/cpp03/http/server4/file_handler.cpp b/asio/src/examples/cpp11/http/server4/file_handler.cpp similarity index 96% rename from asio/src/examples/cpp03/http/server4/file_handler.cpp rename to asio/src/examples/cpp11/http/server4/file_handler.cpp index 53ea3b5fab..e45ffdaf79 100644 --- a/asio/src/examples/cpp03/http/server4/file_handler.cpp +++ b/asio/src/examples/cpp11/http/server4/file_handler.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include "mime_types.hpp" #include "reply.hpp" #include "request.hpp" @@ -74,7 +73,7 @@ void file_handler::operator()(const request& req, reply& rep) rep.content.append(buf, is.gcount()); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = mime_types::extension_to_type(extension); } diff --git a/asio/src/examples/cpp03/http/server4/file_handler.hpp b/asio/src/examples/cpp11/http/server4/file_handler.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server4/file_handler.hpp rename to asio/src/examples/cpp11/http/server4/file_handler.hpp diff --git a/asio/src/examples/cpp03/http/server4/header.hpp b/asio/src/examples/cpp11/http/server4/header.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server4/header.hpp rename to asio/src/examples/cpp11/http/server4/header.hpp diff --git a/asio/src/examples/cpp03/http/server4/main.cpp b/asio/src/examples/cpp11/http/server4/main.cpp similarity index 91% rename from asio/src/examples/cpp03/http/server4/main.cpp rename to asio/src/examples/cpp11/http/server4/main.cpp index fd2430b331..6b052ed26b 100644 --- a/asio/src/examples/cpp03/http/server4/main.cpp +++ b/asio/src/examples/cpp11/http/server4/main.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include "server.hpp" #include "file_handler.hpp" @@ -43,8 +42,11 @@ int main(int argc, char* argv[]) #if defined(SIGQUIT) signals.add(SIGQUIT); #endif // defined(SIGQUIT) - signals.async_wait(boost::bind( - &asio::io_context::stop, &io_context)); + signals.async_wait( + [&io_context](std::error_code, int) + { + io_context.stop(); + }); // Run the server. io_context.run(); diff --git a/asio/src/examples/cpp03/http/server4/mime_types.cpp b/asio/src/examples/cpp11/http/server4/mime_types.cpp similarity index 100% rename from asio/src/examples/cpp03/http/server4/mime_types.cpp rename to asio/src/examples/cpp11/http/server4/mime_types.cpp diff --git a/asio/src/examples/cpp03/http/server4/mime_types.hpp b/asio/src/examples/cpp11/http/server4/mime_types.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server4/mime_types.hpp rename to asio/src/examples/cpp11/http/server4/mime_types.hpp diff --git a/asio/src/examples/cpp03/http/server4/reply.cpp b/asio/src/examples/cpp11/http/server4/reply.cpp similarity index 98% rename from asio/src/examples/cpp03/http/server4/reply.cpp rename to asio/src/examples/cpp11/http/server4/reply.cpp index 949f448d03..6de74d5856 100644 --- a/asio/src/examples/cpp03/http/server4/reply.cpp +++ b/asio/src/examples/cpp11/http/server4/reply.cpp @@ -10,7 +10,6 @@ #include "reply.hpp" #include -#include namespace http { namespace server4 { @@ -246,7 +245,7 @@ reply reply::stock_reply(reply::status_type status) rep.content = stock_replies::to_string(status); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = "text/html"; return rep; diff --git a/asio/src/examples/cpp03/http/server4/reply.hpp b/asio/src/examples/cpp11/http/server4/reply.hpp similarity index 100% rename from asio/src/examples/cpp03/http/server4/reply.hpp rename to asio/src/examples/cpp11/http/server4/reply.hpp diff --git a/asio/src/examples/cpp03/http/server/request.hpp b/asio/src/examples/cpp11/http/server4/request.hpp similarity index 79% rename from asio/src/examples/cpp03/http/server/request.hpp rename to asio/src/examples/cpp11/http/server4/request.hpp index 68ab3e2bd0..fc7d480788 100644 --- a/asio/src/examples/cpp03/http/server/request.hpp +++ b/asio/src/examples/cpp11/http/server4/request.hpp @@ -8,15 +8,15 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef HTTP_REQUEST_HPP -#define HTTP_REQUEST_HPP +#ifndef HTTP_SERVER4_REQUEST_HPP +#define HTTP_SERVER4_REQUEST_HPP #include #include #include "header.hpp" namespace http { -namespace server { +namespace server4 { /// A request received from a client. struct request @@ -28,7 +28,7 @@ struct request std::vector
headers; }; -} // namespace server +} // namespace server4 } // namespace http -#endif // HTTP_REQUEST_HPP +#endif // HTTP_SERVER4_REQUEST_HPP diff --git a/asio/src/examples/cpp03/http/server/request_handler.cpp b/asio/src/examples/cpp11/http/server4/request_handler.cpp similarity index 94% rename from asio/src/examples/cpp03/http/server/request_handler.cpp rename to asio/src/examples/cpp11/http/server4/request_handler.cpp index 3a04a6e52c..5081a0dcf1 100644 --- a/asio/src/examples/cpp03/http/server/request_handler.cpp +++ b/asio/src/examples/cpp11/http/server4/request_handler.cpp @@ -12,13 +12,12 @@ #include #include #include -#include #include "mime_types.hpp" #include "reply.hpp" #include "request.hpp" namespace http { -namespace server { +namespace server4 { request_handler::request_handler(const std::string& doc_root) : doc_root_(doc_root) @@ -74,7 +73,7 @@ void request_handler::handle_request(const request& req, reply& rep) rep.content.append(buf, is.gcount()); rep.headers.resize(2); rep.headers[0].name = "Content-Length"; - rep.headers[0].value = boost::lexical_cast(rep.content.size()); + rep.headers[0].value = std::to_string(rep.content.size()); rep.headers[1].name = "Content-Type"; rep.headers[1].value = mime_types::extension_to_type(extension); } @@ -118,5 +117,5 @@ bool request_handler::url_decode(const std::string& in, std::string& out) return true; } -} // namespace server +} // namespace server4 } // namespace http diff --git a/asio/src/examples/cpp03/http/server/request_handler.hpp b/asio/src/examples/cpp11/http/server4/request_handler.hpp similarity index 76% rename from asio/src/examples/cpp03/http/server/request_handler.hpp rename to asio/src/examples/cpp11/http/server4/request_handler.hpp index 1af9fa5188..0063bb9b1c 100644 --- a/asio/src/examples/cpp03/http/server/request_handler.hpp +++ b/asio/src/examples/cpp11/http/server4/request_handler.hpp @@ -8,23 +8,24 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef HTTP_REQUEST_HANDLER_HPP -#define HTTP_REQUEST_HANDLER_HPP +#ifndef HTTP_SERVER4_REQUEST_HANDLER_HPP +#define HTTP_SERVER4_REQUEST_HANDLER_HPP #include -#include namespace http { -namespace server { +namespace server4 { struct reply; struct request; /// The common handler for all incoming requests. class request_handler - : private boost::noncopyable { public: + request_handler(const request_handler&) = delete; + request_handler& operator=(const request_handler&) = delete; + /// Construct with a directory containing files to be served. explicit request_handler(const std::string& doc_root); @@ -40,7 +41,7 @@ class request_handler static bool url_decode(const std::string& in, std::string& out); }; -} // namespace server +} // namespace server4 } // namespace http -#endif // HTTP_REQUEST_HANDLER_HPP +#endif // HTTP_SERVER4_REQUEST_HANDLER_HPP diff --git a/asio/src/examples/cpp03/http/server/request_parser.cpp b/asio/src/examples/cpp11/http/server4/request_parser.cpp similarity index 75% rename from asio/src/examples/cpp03/http/server/request_parser.cpp rename to asio/src/examples/cpp11/http/server4/request_parser.cpp index e64c703c9b..fc504e99de 100644 --- a/asio/src/examples/cpp03/http/server/request_parser.cpp +++ b/asio/src/examples/cpp11/http/server4/request_parser.cpp @@ -12,7 +12,7 @@ #include "request.hpp" namespace http { -namespace server { +namespace server4 { request_parser::request_parser() : state_(method_start) @@ -24,90 +24,90 @@ void request_parser::reset() state_ = method_start; } -boost::tribool request_parser::consume(request& req, char input) +request_parser::result_type request_parser::consume(request& req, char input) { switch (state_) { case method_start: if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { state_ = method; req.method.push_back(input); - return boost::indeterminate; + return indeterminate; } case method: if (input == ' ') { state_ = uri; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.method.push_back(input); - return boost::indeterminate; + return indeterminate; } case uri: if (input == ' ') { state_ = http_version_h; - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { req.uri.push_back(input); - return boost::indeterminate; + return indeterminate; } case http_version_h: if (input == 'H') { state_ = http_version_t_1; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_t_1: if (input == 'T') { state_ = http_version_t_2; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_t_2: if (input == 'T') { state_ = http_version_p; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_p: if (input == 'P') { state_ = http_version_slash; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_slash: if (input == '/') @@ -115,170 +115,170 @@ boost::tribool request_parser::consume(request& req, char input) req.http_version_major = 0; req.http_version_minor = 0; state_ = http_version_major_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_major_start: if (is_digit(input)) { req.http_version_major = req.http_version_major * 10 + input - '0'; state_ = http_version_major; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_major: if (input == '.') { state_ = http_version_minor_start; - return boost::indeterminate; + return indeterminate; } else if (is_digit(input)) { req.http_version_major = req.http_version_major * 10 + input - '0'; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_minor_start: if (is_digit(input)) { req.http_version_minor = req.http_version_minor * 10 + input - '0'; state_ = http_version_minor; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case http_version_minor: if (input == '\r') { state_ = expecting_newline_1; - return boost::indeterminate; + return indeterminate; } else if (is_digit(input)) { req.http_version_minor = req.http_version_minor * 10 + input - '0'; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case expecting_newline_1: if (input == '\n') { state_ = header_line_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case header_line_start: if (input == '\r') { state_ = expecting_newline_3; - return boost::indeterminate; + return indeterminate; } else if (!req.headers.empty() && (input == ' ' || input == '\t')) { state_ = header_lws; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.headers.push_back(header()); req.headers.back().name.push_back(input); state_ = header_name; - return boost::indeterminate; + return indeterminate; } case header_lws: if (input == '\r') { state_ = expecting_newline_2; - return boost::indeterminate; + return indeterminate; } else if (input == ' ' || input == '\t') { - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { state_ = header_value; req.headers.back().value.push_back(input); - return boost::indeterminate; + return indeterminate; } case header_name: if (input == ':') { state_ = space_before_header_value; - return boost::indeterminate; + return indeterminate; } else if (!is_char(input) || is_ctl(input) || is_tspecial(input)) { - return false; + return bad; } else { req.headers.back().name.push_back(input); - return boost::indeterminate; + return indeterminate; } case space_before_header_value: if (input == ' ') { state_ = header_value; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case header_value: if (input == '\r') { state_ = expecting_newline_2; - return boost::indeterminate; + return indeterminate; } else if (is_ctl(input)) { - return false; + return bad; } else { req.headers.back().value.push_back(input); - return boost::indeterminate; + return indeterminate; } case expecting_newline_2: if (input == '\n') { state_ = header_line_start; - return boost::indeterminate; + return indeterminate; } else { - return false; + return bad; } case expecting_newline_3: - return (input == '\n'); + return (input == '\n') ? good : bad; default: - return false; + return bad; } } @@ -311,5 +311,5 @@ bool request_parser::is_digit(int c) return c >= '0' && c <= '9'; } -} // namespace server +} // namespace server4 } // namespace http diff --git a/asio/src/examples/cpp03/http/server/request_parser.hpp b/asio/src/examples/cpp11/http/server4/request_parser.hpp similarity index 65% rename from asio/src/examples/cpp03/http/server/request_parser.hpp rename to asio/src/examples/cpp11/http/server4/request_parser.hpp index 4563f9f31c..a8c86cd423 100644 --- a/asio/src/examples/cpp03/http/server/request_parser.hpp +++ b/asio/src/examples/cpp11/http/server4/request_parser.hpp @@ -8,14 +8,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef HTTP_REQUEST_PARSER_HPP -#define HTTP_REQUEST_PARSER_HPP +#ifndef HTTP_SERVER4_REQUEST_PARSER_HPP +#define HTTP_SERVER4_REQUEST_PARSER_HPP -#include -#include +#include namespace http { -namespace server { +namespace server4 { struct request; @@ -29,27 +28,29 @@ class request_parser /// Reset to initial parser state. void reset(); - /// Parse some data. The tribool return value is true when a complete request - /// has been parsed, false if the data is invalid, indeterminate when more - /// data is required. The InputIterator return value indicates how much of the - /// input has been consumed. + /// Result of parse. + enum result_type { good, bad, indeterminate }; + + /// Parse some data. The enum return value is good when a complete request has + /// been parsed, bad if the data is invalid, indeterminate when more data is + /// required. The InputIterator return value indicates how much of the input + /// has been consumed. template - boost::tuple parse(request& req, + std::tuple parse(request& req, InputIterator begin, InputIterator end) { while (begin != end) { - boost::tribool result = consume(req, *begin++); - if (result || !result) - return boost::make_tuple(result, begin); + result_type result = consume(req, *begin++); + if (result == good || result == bad) + return std::make_tuple(result, begin); } - boost::tribool result = boost::indeterminate; - return boost::make_tuple(result, begin); + return std::make_tuple(indeterminate, begin); } private: /// Handle the next character of input. - boost::tribool consume(request& req, char input); + result_type consume(request& req, char input); /// Check if a byte is an HTTP character. static bool is_char(int c); @@ -89,7 +90,7 @@ class request_parser } state_; }; -} // namespace server +} // namespace server4 } // namespace http -#endif // HTTP_REQUEST_PARSER_HPP +#endif // HTTP_SERVER4_REQUEST_PARSER_HPP diff --git a/asio/src/examples/cpp03/http/server4/server.cpp b/asio/src/examples/cpp11/http/server4/server.cpp similarity index 92% rename from asio/src/examples/cpp03/http/server4/server.cpp rename to asio/src/examples/cpp11/http/server4/server.cpp index a1b24ce44e..ff1f9028ba 100644 --- a/asio/src/examples/cpp03/http/server4/server.cpp +++ b/asio/src/examples/cpp11/http/server4/server.cpp @@ -17,7 +17,7 @@ namespace server4 { server::server(asio::io_context& io_context, const std::string& address, const std::string& port, - boost::function request_handler) + std::function request_handler) : request_handler_(request_handler) { tcp::resolver resolver(io_context); @@ -29,7 +29,7 @@ server::server(asio::io_context& io_context, // Enable the pseudo-keywords reenter, yield and fork. #include -void server::operator()(asio::error_code ec, std::size_t length) +void server::operator()(std::error_code ec, std::size_t length) { // In this example we keep the error handling code in one place by // hoisting it outside the coroutine. An alternative approach would be to @@ -67,7 +67,7 @@ void server::operator()(asio::error_code ec, std::size_t length) } while (is_parent()); // Create the objects needed to receive a request on the connection. - buffer_.reset(new boost::array); + buffer_.reset(new std::array); request_.reset(new request); // Loop until a complete request (or an invalid one) has been received. @@ -79,17 +79,17 @@ void server::operator()(asio::error_code ec, std::size_t length) yield socket_->async_read_some(asio::buffer(*buffer_), *this); // Parse the data we just received. - boost::tie(valid_request_, boost::tuples::ignore) + std::tie(parse_result_, std::ignore) = request_parser_.parse(*request_, buffer_->data(), buffer_->data() + length); // An indeterminate result means we need more data, so keep looping. - } while (boost::indeterminate(valid_request_)); + } while (parse_result_ == request_parser::indeterminate); // Create the reply object that will be sent back to the client. reply_.reset(new reply); - if (valid_request_) + if (parse_result_ == request_parser::good) { // A valid request was received. Call the user-supplied function object // to process the request and compose a reply. diff --git a/asio/src/examples/cpp03/http/server4/server.hpp b/asio/src/examples/cpp11/http/server4/server.hpp similarity index 72% rename from asio/src/examples/cpp03/http/server4/server.hpp rename to asio/src/examples/cpp11/http/server4/server.hpp index 21fc015483..f19a6706d9 100644 --- a/asio/src/examples/cpp03/http/server4/server.hpp +++ b/asio/src/examples/cpp11/http/server4/server.hpp @@ -12,10 +12,10 @@ #define HTTP_SERVER4_SERVER_HPP #include +#include +#include +#include #include -#include -#include -#include #include "request_parser.hpp" namespace http { @@ -32,39 +32,39 @@ class server : asio::coroutine /// serve up files from the given directory. explicit server(asio::io_context& io_context, const std::string& address, const std::string& port, - boost::function request_handler); + std::function request_handler); /// Perform work associated with the server. void operator()( - asio::error_code ec = asio::error_code(), + std::error_code ec = std::error_code(), std::size_t length = 0); private: typedef asio::ip::tcp tcp; /// The user-supplied handler for all incoming requests. - boost::function request_handler_; + std::function request_handler_; /// Acceptor used to listen for incoming connections. - boost::shared_ptr acceptor_; + std::shared_ptr acceptor_; /// The current connection from a client. - boost::shared_ptr socket_; + std::shared_ptr socket_; /// Buffer for incoming data. - boost::shared_ptr > buffer_; + std::shared_ptr> buffer_; /// The incoming request. - boost::shared_ptr request_; + std::shared_ptr request_; /// Whether the request is valid or not. - boost::tribool valid_request_; + request_parser::result_type parse_result_; /// The parser for the incoming request. request_parser request_parser_; /// The reply to be sent back to the client. - boost::shared_ptr reply_; + std::shared_ptr reply_; }; } // namespace server4 diff --git a/asio/src/examples/cpp03/icmp/.gitignore b/asio/src/examples/cpp11/icmp/.gitignore similarity index 100% rename from asio/src/examples/cpp03/icmp/.gitignore rename to asio/src/examples/cpp11/icmp/.gitignore diff --git a/asio/src/examples/cpp03/icmp/icmp_header.hpp b/asio/src/examples/cpp11/icmp/icmp_header.hpp similarity index 100% rename from asio/src/examples/cpp03/icmp/icmp_header.hpp rename to asio/src/examples/cpp11/icmp/icmp_header.hpp diff --git a/asio/src/examples/cpp03/icmp/ipv4_header.hpp b/asio/src/examples/cpp11/icmp/ipv4_header.hpp similarity index 100% rename from asio/src/examples/cpp03/icmp/ipv4_header.hpp rename to asio/src/examples/cpp11/icmp/ipv4_header.hpp diff --git a/asio/src/examples/cpp03/icmp/ping.cpp b/asio/src/examples/cpp11/icmp/ping.cpp similarity index 94% rename from asio/src/examples/cpp03/icmp/ping.cpp rename to asio/src/examples/cpp11/icmp/ping.cpp index ef6d2333c7..d871512777 100644 --- a/asio/src/examples/cpp03/icmp/ping.cpp +++ b/asio/src/examples/cpp11/icmp/ping.cpp @@ -9,7 +9,6 @@ // #include -#include #include #include #include @@ -59,7 +58,7 @@ class pinger // Wait up to five seconds for a reply. num_replies_ = 0; timer_.expires_at(time_sent_ + chrono::seconds(5)); - timer_.async_wait(boost::bind(&pinger::handle_timeout, this)); + timer_.async_wait(std::bind(&pinger::handle_timeout, this)); } void handle_timeout() @@ -69,7 +68,7 @@ class pinger // Requests must be sent no less than one second apart. timer_.expires_at(time_sent_ + chrono::seconds(1)); - timer_.async_wait(boost::bind(&pinger::start_send, this)); + timer_.async_wait(std::bind(&pinger::start_send, this)); } void start_receive() @@ -79,7 +78,7 @@ class pinger // Wait for a reply. We prepare the buffer to receive up to 64KB. socket_.async_receive(reply_buffer_.prepare(65536), - boost::bind(&pinger::handle_receive, this, boost::placeholders::_2)); + std::bind(&pinger::handle_receive, this, std::placeholders::_2)); } void handle_receive(std::size_t length) diff --git a/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp b/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp index 2ac2096e45..08ddb525cf 100644 --- a/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp +++ b/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp @@ -142,13 +142,13 @@ class handler_priority_queue : public asio::execution_context //---------------------------------------------------------------------- -void high_priority_handler(const asio::error_code& /*ec*/, +void high_priority_handler(const std::error_code& /*ec*/, tcp::socket /*socket*/) { std::cout << "High priority handler\n"; } -void middle_priority_handler(const asio::error_code& /*ec*/) +void middle_priority_handler(const std::error_code& /*ec*/) { std::cout << "Middle priority handler\n"; } diff --git a/asio/src/examples/cpp03/iostreams/daytime_client.cpp b/asio/src/examples/cpp11/iostreams/daytime_client.cpp similarity index 100% rename from asio/src/examples/cpp03/iostreams/daytime_client.cpp rename to asio/src/examples/cpp11/iostreams/daytime_client.cpp diff --git a/asio/src/examples/cpp03/iostreams/daytime_server.cpp b/asio/src/examples/cpp11/iostreams/daytime_server.cpp similarity index 97% rename from asio/src/examples/cpp03/iostreams/daytime_server.cpp rename to asio/src/examples/cpp11/iostreams/daytime_server.cpp index d9c03fbe37..da802fd1b4 100644 --- a/asio/src/examples/cpp03/iostreams/daytime_server.cpp +++ b/asio/src/examples/cpp11/iostreams/daytime_server.cpp @@ -34,7 +34,7 @@ int main() for (;;) { tcp::iostream stream; - asio::error_code ec; + std::error_code ec; acceptor.accept(stream.socket(), ec); if (!ec) { diff --git a/asio/src/examples/cpp11/local/connect_pair.cpp b/asio/src/examples/cpp11/local/connect_pair.cpp index fc8feb59a1..ed8b357699 100644 --- a/asio/src/examples/cpp11/local/connect_pair.cpp +++ b/asio/src/examples/cpp11/local/connect_pair.cpp @@ -44,7 +44,7 @@ class uppercase_filter } else { - throw asio::system_error(ec); + throw std::system_error(ec); } }); } @@ -61,7 +61,7 @@ class uppercase_filter } else { - throw asio::system_error(ec); + throw std::system_error(ec); } }); } diff --git a/asio/src/examples/cpp03/porthopper/.gitignore b/asio/src/examples/cpp11/porthopper/.gitignore similarity index 100% rename from asio/src/examples/cpp03/porthopper/.gitignore rename to asio/src/examples/cpp11/porthopper/.gitignore diff --git a/asio/src/examples/cpp03/porthopper/client.cpp b/asio/src/examples/cpp11/porthopper/client.cpp similarity index 75% rename from asio/src/examples/cpp03/porthopper/client.cpp rename to asio/src/examples/cpp11/porthopper/client.cpp index 97ab025dba..4206e46a71 100644 --- a/asio/src/examples/cpp03/porthopper/client.cpp +++ b/asio/src/examples/cpp11/porthopper/client.cpp @@ -9,18 +9,15 @@ // #include -#include -#include -#include -#include #include #include #include #include +#include #include +#include #include "protocol.hpp" -using namespace boost; using asio::ip::tcp; using asio::ip::udp; @@ -48,11 +45,10 @@ int main(int argc, char* argv[]) control_socket.connect(remote_endpoint); // Create a datagram socket to receive data from the server. - boost::shared_ptr data_socket( - new udp::socket(io_context, udp::endpoint(udp::v4(), 0))); + udp::socket data_socket(io_context, udp::endpoint(udp::v4(), 0)); // Determine what port we will receive data on. - udp::endpoint data_endpoint = data_socket->local_endpoint(); + udp::endpoint data_endpoint = data_socket.local_endpoint(); // Ask the server to start sending us data. control_request start = control_request::start(data_endpoint.port()); @@ -66,7 +62,7 @@ int main(int argc, char* argv[]) { // Receive a frame from the server. frame f; - data_socket->receive(f.to_buffers(), 0); + data_socket.receive(f.to_buffers(), 0); if (f.number() > last_frame_number) { last_frame_number = f.number(); @@ -80,20 +76,20 @@ int main(int argc, char* argv[]) std::cout << " Starting renegotiation"; // Create the new data socket. - boost::shared_ptr new_data_socket( - new udp::socket(io_context, udp::endpoint(udp::v4(), 0))); + udp::socket new_data_socket(io_context, udp::endpoint(udp::v4(), 0)); // Determine the new port we will use to receive data. - udp::endpoint new_data_endpoint = new_data_socket->local_endpoint(); + udp::endpoint new_data_endpoint = new_data_socket.local_endpoint(); // Ask the server to switch over to the new port. control_request change = control_request::change( data_endpoint.port(), new_data_endpoint.port()); - asio::error_code control_result; + std::error_code control_result; asio::async_write(control_socket, change.to_buffers(), - ( - lambda::var(control_result) = lambda::_1 - )); + [&](std::error_code ec, std::size_t /*length*/) + { + control_result = ec; + }); // Try to receive a frame from the server on the new data socket. If we // successfully receive a frame on this new data socket we can consider @@ -101,20 +97,19 @@ int main(int argc, char* argv[]) // socket, which will cause any outstanding receive operation on it to be // cancelled. frame f1; - asio::error_code new_data_socket_result; - new_data_socket->async_receive(f1.to_buffers(), - ( - // Note: lambda::_1 is the first argument to the callback handler, - // which in this case is the error code for the operation. - lambda::var(new_data_socket_result) = lambda::_1, - lambda::if_(!lambda::_1) - [ + std::error_code new_data_socket_result; + new_data_socket.async_receive(f1.to_buffers(), + [&](std::error_code ec, std::size_t /*length*/) + { + new_data_socket_result = ec; + if (!ec) + { // We have successfully received a frame on the new data socket, // so we can close the old data socket. This will cancel any // outstanding receive operation on the old data socket. - lambda::var(data_socket) = boost::shared_ptr() - ] - )); + data_socket.close(); + } + }); // This loop will continue until we have successfully completed the // renegotiation (i.e. received a frame on the new data socket), or some @@ -130,18 +125,19 @@ int main(int argc, char* argv[]) // complete. frame f2; done = true; // Let's be optimistic. - if (data_socket) // Might have been closed by new_data_socket's handler. + if (data_socket.is_open()) // May have been closed by receive handler. { - data_socket->async_receive(f2.to_buffers(), 0, - ( - lambda::if_(!lambda::_1) - [ + data_socket.async_receive(f2.to_buffers(), 0, + [&](std::error_code ec, std::size_t /*length*/) + { + if (!ec) + { // We have successfully received a frame on the old data // socket. Stop the io_context so that we can print it. - lambda::bind(&asio::io_context::stop, &io_context), - lambda::var(done) = false - ] - )); + io_context.stop(); + done = false; + } + }); } // Run the operations in parallel. This will block until all operations @@ -166,15 +162,15 @@ int main(int argc, char* argv[]) // the renegotation, or an error has occurred. First we'll check for // errors. if (control_result) - throw asio::system_error(control_result); + throw std::system_error(control_result); if (new_data_socket_result) - throw asio::system_error(new_data_socket_result); + throw std::system_error(new_data_socket_result); // If we get here it means we have successfully started receiving data on // the new data socket. This new data socket will be used from now on // (until the next time we renegotiate). std::cout << " Renegotiation complete"; - data_socket = new_data_socket; + data_socket = std::move(new_data_socket); data_endpoint = new_data_endpoint; if (f1.number() > last_frame_number) { diff --git a/asio/src/examples/cpp03/porthopper/protocol.hpp b/asio/src/examples/cpp11/porthopper/protocol.hpp similarity index 94% rename from asio/src/examples/cpp03/porthopper/protocol.hpp rename to asio/src/examples/cpp11/porthopper/protocol.hpp index 886ba1c9e6..3ab3ef2416 100644 --- a/asio/src/examples/cpp03/porthopper/protocol.hpp +++ b/asio/src/examples/cpp11/porthopper/protocol.hpp @@ -11,8 +11,8 @@ #ifndef PORTHOPPER_PROTOCOL_HPP #define PORTHOPPER_PROTOCOL_HPP -#include #include +#include #include #include #include @@ -69,9 +69,9 @@ class control_request } // Obtain buffers for reading from or writing to a socket. - boost::array to_buffers() + std::array to_buffers() { - boost::array buffers + std::array buffers = { { asio::buffer(data_) } }; return buffers; } @@ -134,9 +134,9 @@ class frame } // Obtain buffers for reading from or writing to a socket. - boost::array to_buffers() + std::array to_buffers() { - boost::array buffers + std::array buffers = { { asio::buffer(data_) } }; return buffers; } diff --git a/asio/src/examples/cpp03/porthopper/server.cpp b/asio/src/examples/cpp11/porthopper/server.cpp similarity index 85% rename from asio/src/examples/cpp03/porthopper/server.cpp rename to asio/src/examples/cpp11/porthopper/server.cpp index 93291b2380..6fb27bd9ca 100644 --- a/asio/src/examples/cpp03/porthopper/server.cpp +++ b/asio/src/examples/cpp11/porthopper/server.cpp @@ -9,21 +9,21 @@ // #include -#include -#include #include #include #include +#include #include +#include #include #include "protocol.hpp" using asio::ip::tcp; using asio::ip::udp; -typedef boost::shared_ptr tcp_socket_ptr; -typedef boost::shared_ptr timer_ptr; -typedef boost::shared_ptr control_request_ptr; +typedef std::shared_ptr tcp_socket_ptr; +typedef std::shared_ptr timer_ptr; +typedef std::shared_ptr control_request_ptr; class server { @@ -38,35 +38,35 @@ class server // Start waiting for a new control connection. tcp_socket_ptr new_socket(new tcp::socket(acceptor_.get_executor())); acceptor_.async_accept(*new_socket, - boost::bind(&server::handle_accept, this, + std::bind(&server::handle_accept, this, asio::placeholders::error, new_socket)); // Start the timer used to generate outgoing frames. timer_.expires_after(asio::chrono::milliseconds(100)); - timer_.async_wait(boost::bind(&server::handle_timer, this)); + timer_.async_wait(std::bind(&server::handle_timer, this)); } // Handle a new control connection. - void handle_accept(const asio::error_code& ec, tcp_socket_ptr socket) + void handle_accept(const std::error_code& ec, tcp_socket_ptr socket) { if (!ec) { // Start receiving control requests on the connection. control_request_ptr request(new control_request); asio::async_read(*socket, request->to_buffers(), - boost::bind(&server::handle_control_request, this, + std::bind(&server::handle_control_request, this, asio::placeholders::error, socket, request)); } // Start waiting for a new control connection. tcp_socket_ptr new_socket(new tcp::socket(acceptor_.get_executor())); acceptor_.async_accept(*new_socket, - boost::bind(&server::handle_accept, this, + std::bind(&server::handle_accept, this, asio::placeholders::error, new_socket)); } // Handle a new control request. - void handle_control_request(const asio::error_code& ec, + void handle_control_request(const std::error_code& ec, tcp_socket_ptr socket, control_request_ptr request) { if (!ec) @@ -76,7 +76,7 @@ class server new asio::steady_timer(acceptor_.get_executor())); delay_timer->expires_after(asio::chrono::seconds(2)); delay_timer->async_wait( - boost::bind(&server::handle_control_request_timer, this, + std::bind(&server::handle_control_request_timer, this, socket, request, delay_timer)); } } @@ -88,7 +88,7 @@ class server // subscriptions must be stored on the server as a complete endpoint, not // just a port. We use the non-throwing overload of remote_endpoint() since // it may fail if the socket is no longer connected. - asio::error_code ec; + std::error_code ec; tcp::endpoint remote_endpoint = socket->remote_endpoint(ec); if (!ec) { @@ -111,7 +111,7 @@ class server // Wait for next control request on this connection. asio::async_read(*socket, request->to_buffers(), - boost::bind(&server::handle_control_request, this, + std::bind(&server::handle_control_request, this, asio::placeholders::error, socket, request)); } @@ -135,13 +135,13 @@ class server std::set::iterator j; for (j = subscribers_.begin(); j != subscribers_.end(); ++j) { - asio::error_code ec; + std::error_code ec; udp_socket_.send_to(f.to_buffers(), *j, 0, ec); } // Wait for next timeout. timer_.expires_after(asio::chrono::milliseconds(100)); - timer_.async_wait(boost::bind(&server::handle_timer, this)); + timer_.async_wait(std::bind(&server::handle_timer, this)); } private: diff --git a/asio/src/examples/cpp03/serialization/.gitignore b/asio/src/examples/cpp11/serialization/.gitignore similarity index 100% rename from asio/src/examples/cpp03/serialization/.gitignore rename to asio/src/examples/cpp11/serialization/.gitignore diff --git a/asio/src/examples/cpp03/serialization/client.cpp b/asio/src/examples/cpp11/serialization/client.cpp similarity index 96% rename from asio/src/examples/cpp03/serialization/client.cpp rename to asio/src/examples/cpp11/serialization/client.cpp index f2c5837565..a0b6a98c2c 100644 --- a/asio/src/examples/cpp03/serialization/client.cpp +++ b/asio/src/examples/cpp11/serialization/client.cpp @@ -9,7 +9,7 @@ // #include -#include +#include #include #include #include "connection.hpp" // Must come before boost/serialization headers. @@ -35,7 +35,7 @@ class client // Start an asynchronous connect operation. asio::async_connect(connection_.socket(), endpoint_iterator, - boost::bind(&client::handle_connect, this, + std::bind(&client::handle_connect, this, asio::placeholders::error)); } @@ -48,7 +48,7 @@ class client // of stocks. The connection::async_read() function will automatically // decode the data that is read from the underlying socket. connection_.async_read(stocks_, - boost::bind(&client::handle_read, this, + std::bind(&client::handle_read, this, asio::placeholders::error)); } else diff --git a/asio/src/examples/cpp03/serialization/connection.hpp b/asio/src/examples/cpp11/serialization/connection.hpp similarity index 75% rename from asio/src/examples/cpp03/serialization/connection.hpp rename to asio/src/examples/cpp11/serialization/connection.hpp index 397e84f08e..d7e430a29a 100644 --- a/asio/src/examples/cpp03/serialization/connection.hpp +++ b/asio/src/examples/cpp11/serialization/connection.hpp @@ -14,12 +14,12 @@ #include #include #include -#include -#include -#include +#include #include +#include #include #include +#include #include namespace s11n_example { @@ -35,7 +35,7 @@ class connection { public: /// Constructor. - connection(const asio::executor& ex) + connection(const asio::any_io_executor& ex) : socket_(ex) { } @@ -64,8 +64,8 @@ class connection if (!header_stream || header_stream.str().size() != header_length) { // Something went wrong, inform the caller. - asio::error_code error(asio::error::invalid_argument); - asio::post(socket_.get_executor(), boost::bind(handler, error)); + std::error_code error(asio::error::invalid_argument); + asio::post(socket_.get_executor(), std::bind(handler, error)); return; } outbound_header_ = header_stream.str(); @@ -83,26 +83,22 @@ class connection void async_read(T& t, Handler handler) { // Issue a read operation to read exactly the number of bytes in a header. - void (connection::*f)( - const asio::error_code&, - T&, boost::tuple) + void (connection::*f)(const std::error_code&, T&, std::tuple) = &connection::handle_read_header; asio::async_read(socket_, asio::buffer(inbound_header_), - boost::bind(f, - this, asio::placeholders::error, boost::ref(t), - boost::make_tuple(handler))); + std::bind(f, + this, asio::placeholders::error, std::ref(t), + std::make_tuple(handler))); } - /// Handle a completed read of a message header. The handler is passed using - /// a tuple since boost::bind seems to have trouble binding a function object - /// created using boost::bind as a parameter. + /// Handle a completed read of a message header. template - void handle_read_header(const asio::error_code& e, - T& t, boost::tuple handler) + void handle_read_header(const std::error_code& e, + T& t, std::tuple handler) { if (e) { - boost::get<0>(handler)(e); + std::get<0>(handler)(e); } else { @@ -112,31 +108,31 @@ class connection if (!(is >> std::hex >> inbound_data_size)) { // Header doesn't seem to be valid. Inform the caller. - asio::error_code error(asio::error::invalid_argument); - boost::get<0>(handler)(error); + std::error_code error(asio::error::invalid_argument); + std::get<0>(handler)(error); return; } // Start an asynchronous call to receive the data. inbound_data_.resize(inbound_data_size); void (connection::*f)( - const asio::error_code&, - T&, boost::tuple) + const std::error_code&, + T&, std::tuple) = &connection::handle_read_data; asio::async_read(socket_, asio::buffer(inbound_data_), - boost::bind(f, this, - asio::placeholders::error, boost::ref(t), handler)); + std::bind(f, this, + asio::placeholders::error, std::ref(t), handler)); } } /// Handle a completed read of message data. template - void handle_read_data(const asio::error_code& e, - T& t, boost::tuple handler) + void handle_read_data(const std::error_code& e, + T& t, std::tuple handler) { if (e) { - boost::get<0>(handler)(e); + std::get<0>(handler)(e); } else { @@ -151,13 +147,13 @@ class connection catch (std::exception& e) { // Unable to decode data. - asio::error_code error(asio::error::invalid_argument); - boost::get<0>(handler)(error); + std::error_code error(asio::error::invalid_argument); + std::get<0>(handler)(error); return; } // Inform caller that data has been received ok. - boost::get<0>(handler)(e); + std::get<0>(handler)(e); } } @@ -181,7 +177,7 @@ class connection std::vector inbound_data_; }; -typedef boost::shared_ptr connection_ptr; +typedef std::shared_ptr connection_ptr; } // namespace s11n_example diff --git a/asio/src/examples/cpp03/serialization/server.cpp b/asio/src/examples/cpp11/serialization/server.cpp similarity index 88% rename from asio/src/examples/cpp03/serialization/server.cpp rename to asio/src/examples/cpp11/serialization/server.cpp index 78fa475cbb..9e4c30706e 100644 --- a/asio/src/examples/cpp03/serialization/server.cpp +++ b/asio/src/examples/cpp11/serialization/server.cpp @@ -9,8 +9,7 @@ // #include -#include -#include +#include #include #include #include "connection.hpp" // Must come before boost/serialization headers. @@ -57,12 +56,12 @@ class server // Start an accept operation for a new connection. connection_ptr new_conn(new connection(acceptor_.get_executor())); acceptor_.async_accept(new_conn->socket(), - boost::bind(&server::handle_accept, this, + std::bind(&server::handle_accept, this, asio::placeholders::error, new_conn)); } /// Handle completion of a accept operation. - void handle_accept(const asio::error_code& e, connection_ptr conn) + void handle_accept(const std::error_code& e, connection_ptr conn) { if (!e) { @@ -70,19 +69,19 @@ class server // client. The connection::async_write() function will automatically // serialize the data structure for us. conn->async_write(stocks_, - boost::bind(&server::handle_write, this, + std::bind(&server::handle_write, this, asio::placeholders::error, conn)); } // Start an accept operation for a new connection. connection_ptr new_conn(new connection(acceptor_.get_executor())); acceptor_.async_accept(new_conn->socket(), - boost::bind(&server::handle_accept, this, + std::bind(&server::handle_accept, this, asio::placeholders::error, new_conn)); } /// Handle completion of a write operation. - void handle_write(const asio::error_code& e, connection_ptr conn) + void handle_write(const std::error_code& e, connection_ptr conn) { // Nothing to do. The socket will be closed automatically when the last // reference to the connection object goes away. @@ -108,7 +107,7 @@ int main(int argc, char* argv[]) std::cerr << "Usage: server " << std::endl; return 1; } - unsigned short port = boost::lexical_cast(argv[1]); + unsigned short port = std::stoi(argv[1]); asio::io_context io_context; s11n_example::server server(io_context, port); diff --git a/asio/src/examples/cpp03/serialization/stock.hpp b/asio/src/examples/cpp11/serialization/stock.hpp similarity index 100% rename from asio/src/examples/cpp03/serialization/stock.hpp rename to asio/src/examples/cpp11/serialization/stock.hpp diff --git a/asio/src/examples/cpp03/services/.gitignore b/asio/src/examples/cpp11/services/.gitignore similarity index 100% rename from asio/src/examples/cpp03/services/.gitignore rename to asio/src/examples/cpp11/services/.gitignore diff --git a/asio/src/examples/cpp03/services/basic_logger.hpp b/asio/src/examples/cpp11/services/basic_logger.hpp similarity index 94% rename from asio/src/examples/cpp03/services/basic_logger.hpp rename to asio/src/examples/cpp11/services/basic_logger.hpp index 7117868c2b..08cda1dee2 100644 --- a/asio/src/examples/cpp03/services/basic_logger.hpp +++ b/asio/src/examples/cpp11/services/basic_logger.hpp @@ -12,7 +12,6 @@ #define SERVICES_BASIC_LOGGER_HPP #include -#include #include namespace services { @@ -21,7 +20,6 @@ namespace services { /// typedef. template class basic_logger - : private boost::noncopyable { public: /// The type of the service that will be used to provide timer operations. @@ -46,6 +44,9 @@ class basic_logger service_.create(impl_, identifier); } + basic_logger(const basic_logger&) = delete; + basic_logger& operator=(basic_logger&) = delete; + /// Destructor. ~basic_logger() { diff --git a/asio/src/examples/cpp03/services/daytime_client.cpp b/asio/src/examples/cpp11/services/daytime_client.cpp similarity index 92% rename from asio/src/examples/cpp03/services/daytime_client.cpp rename to asio/src/examples/cpp11/services/daytime_client.cpp index 7d41731902..00089e667f 100644 --- a/asio/src/examples/cpp03/services/daytime_client.cpp +++ b/asio/src/examples/cpp11/services/daytime_client.cpp @@ -9,7 +9,7 @@ // #include -#include +#include #include #include "logger.hpp" @@ -25,7 +25,7 @@ void read_handler(const asio::error_code& e, std::cout.write(read_buffer, bytes_transferred); s->async_read_some(asio::buffer(read_buffer), - boost::bind(read_handler, asio::placeholders::error, + std::bind(read_handler, asio::placeholders::error, asio::placeholders::bytes_transferred, s)); } else @@ -51,7 +51,7 @@ void connect_handler(const asio::error_code& e, tcp::socket* s) logger.log("Connection established"); s->async_read_some(asio::buffer(read_buffer), - boost::bind(read_handler, asio::placeholders::error, + std::bind(read_handler, asio::placeholders::error, asio::placeholders::bytes_transferred, s)); } else @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) // Start an asynchronous connect. tcp::socket socket(io_context); asio::async_connect(socket, endpoints, - boost::bind(connect_handler, + std::bind(connect_handler, asio::placeholders::error, &socket)); // Run the io_context until all operations have finished. diff --git a/asio/src/examples/cpp03/services/logger.hpp b/asio/src/examples/cpp11/services/logger.hpp similarity index 100% rename from asio/src/examples/cpp03/services/logger.hpp rename to asio/src/examples/cpp11/services/logger.hpp diff --git a/asio/src/examples/cpp03/services/logger_service.cpp b/asio/src/examples/cpp11/services/logger_service.cpp similarity index 100% rename from asio/src/examples/cpp03/services/logger_service.cpp rename to asio/src/examples/cpp11/services/logger_service.cpp diff --git a/asio/src/examples/cpp03/services/logger_service.hpp b/asio/src/examples/cpp11/services/logger_service.hpp similarity index 86% rename from asio/src/examples/cpp03/services/logger_service.hpp rename to asio/src/examples/cpp11/services/logger_service.hpp index e38cb1a727..82c4446a70 100644 --- a/asio/src/examples/cpp03/services/logger_service.hpp +++ b/asio/src/examples/cpp11/services/logger_service.hpp @@ -12,13 +12,11 @@ #define SERVICES_LOGGER_SERVICE_HPP #include -#include -#include -#include -#include +#include #include #include #include +#include namespace services { @@ -45,19 +43,21 @@ class logger_service : asio::execution_context::service(context), work_io_context_(), work_(asio::make_work_guard(work_io_context_)), - work_thread_(new asio::thread( - boost::bind(&asio::io_context::run, &work_io_context_))) + work_thread_([this]{ work_io_context_.run(); }) { } + logger_service(const logger_service&) = delete; + logger_service& operator=(const logger_service&) = delete;; + /// Destructor shuts down the private io_context. ~logger_service() { /// Indicate that we have finished with the private io_context. Its /// io_context::run() function will exit once all other work has completed. work_.reset(); - if (work_thread_) - work_thread_->join(); + if (work_thread_.joinable()) + work_thread_.join(); } /// Destroy all user-defined handler objects owned by the service. @@ -91,8 +91,8 @@ class logger_service void use_file(impl_type& /*impl*/, const std::string& file) { // Pass the work of opening the file to the background thread. - asio::post(work_io_context_, boost::bind( - &logger_service::use_file_impl, this, file)); + asio::post(work_io_context_, + std::bind(&logger_service::use_file_impl, this, file)); } /// Log a message. @@ -103,8 +103,8 @@ class logger_service os << impl->identifier << ": " << message; // Pass the work of writing to the file to the background thread. - asio::post(work_io_context_, boost::bind( - &logger_service::log_impl, this, os.str())); + asio::post(work_io_context_, + std::bind(&logger_service::log_impl, this, os.str())); } private: @@ -134,7 +134,7 @@ class logger_service asio::io_context::executor_type> work_; /// Thread used for running the work io_context's run loop. - boost::scoped_ptr work_thread_; + std::thread work_thread_; /// The file to which log messages will be written. std::ofstream ofstream_; diff --git a/asio/src/examples/cpp11/socks4/socks4.hpp b/asio/src/examples/cpp11/socks4/socks4.hpp index aae2063687..a318322865 100644 --- a/asio/src/examples/cpp11/socks4/socks4.hpp +++ b/asio/src/examples/cpp11/socks4/socks4.hpp @@ -39,7 +39,7 @@ class request // Only IPv4 is supported by the SOCKS 4 protocol. if (endpoint.protocol() != asio::ip::tcp::v4()) { - throw asio::system_error( + throw std::system_error( asio::error::address_family_not_supported); } diff --git a/asio/src/examples/cpp11/spawn/echo_server.cpp b/asio/src/examples/cpp11/spawn/echo_server.cpp index b90380a993..5a094825c6 100644 --- a/asio/src/examples/cpp11/spawn/echo_server.cpp +++ b/asio/src/examples/cpp11/spawn/echo_server.cpp @@ -57,7 +57,7 @@ class session : public std::enable_shared_from_this { while (socket_.is_open()) { - asio::error_code ignored_ec; + std::error_code ignored_ec; timer_.async_wait(yield[ignored_ec]); if (timer_.expiry() <= asio::steady_timer::clock_type::now()) socket_.close(); @@ -91,7 +91,7 @@ int main(int argc, char* argv[]) for (;;) { - asio::error_code ec; + std::error_code ec; tcp::socket socket(io_context); acceptor.async_accept(socket, yield[ec]); if (!ec) diff --git a/asio/src/examples/cpp03/tutorial/daytime1/.gitignore b/asio/src/examples/cpp11/tutorial/daytime1/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime1/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime1/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime1/client.cpp b/asio/src/examples/cpp11/tutorial/daytime1/client.cpp similarity index 87% rename from asio/src/examples/cpp03/tutorial/daytime1/client.cpp rename to asio/src/examples/cpp11/tutorial/daytime1/client.cpp index 57c6dacccc..bea3f6e20c 100644 --- a/asio/src/examples/cpp03/tutorial/daytime1/client.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime1/client.cpp @@ -8,8 +8,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include -#include #include using asio::ip::tcp; @@ -35,15 +35,15 @@ int main(int argc, char* argv[]) for (;;) { - boost::array buf; - asio::error_code error; + std::array buf; + std::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. + throw std::system_error(error); // Some other error. std::cout.write(buf.data(), len); } diff --git a/asio/src/examples/cpp03/tutorial/daytime2/.gitignore b/asio/src/examples/cpp11/tutorial/daytime2/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime2/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime2/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime2/server.cpp b/asio/src/examples/cpp11/tutorial/daytime2/server.cpp similarity index 96% rename from asio/src/examples/cpp03/tutorial/daytime2/server.cpp rename to asio/src/examples/cpp11/tutorial/daytime2/server.cpp index 0304136784..4058ec4ff4 100644 --- a/asio/src/examples/cpp03/tutorial/daytime2/server.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime2/server.cpp @@ -37,7 +37,7 @@ int main() std::string message = make_daytime_string(); - asio::error_code ignored_error; + std::error_code ignored_error; asio::write(socket, asio::buffer(message), ignored_error); } } diff --git a/asio/src/examples/cpp03/tutorial/daytime3/.gitignore b/asio/src/examples/cpp11/tutorial/daytime3/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime3/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime3/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime3/server.cpp b/asio/src/examples/cpp11/tutorial/daytime3/server.cpp similarity index 81% rename from asio/src/examples/cpp03/tutorial/daytime3/server.cpp rename to asio/src/examples/cpp11/tutorial/daytime3/server.cpp index f3258ded2b..c0f88e2039 100644 --- a/asio/src/examples/cpp03/tutorial/daytime3/server.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime3/server.cpp @@ -9,11 +9,10 @@ // #include +#include #include +#include #include -#include -#include -#include #include using asio::ip::tcp; @@ -26,10 +25,10 @@ std::string make_daytime_string() } class tcp_connection - : public boost::enable_shared_from_this + : public std::enable_shared_from_this { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; static pointer create(asio::io_context& io_context) { @@ -46,7 +45,7 @@ class tcp_connection message_ = make_daytime_string(); asio::async_write(socket_, asio::buffer(message_), - boost::bind(&tcp_connection::handle_write, shared_from_this(), + std::bind(&tcp_connection::handle_write, shared_from_this(), asio::placeholders::error, asio::placeholders::bytes_transferred)); } @@ -57,7 +56,7 @@ class tcp_connection { } - void handle_write(const asio::error_code& /*error*/, + void handle_write(const std::error_code& /*error*/, size_t /*bytes_transferred*/) { } @@ -83,12 +82,12 @@ class tcp_server tcp_connection::create(io_context_); acceptor_.async_accept(new_connection->socket(), - boost::bind(&tcp_server::handle_accept, this, new_connection, + std::bind(&tcp_server::handle_accept, this, new_connection, asio::placeholders::error)); } void handle_accept(tcp_connection::pointer new_connection, - const asio::error_code& error) + const std::error_code& error) { if (!error) { diff --git a/asio/src/examples/cpp03/tutorial/daytime4/.gitignore b/asio/src/examples/cpp11/tutorial/daytime4/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime4/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime4/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime4/client.cpp b/asio/src/examples/cpp11/tutorial/daytime4/client.cpp similarity index 90% rename from asio/src/examples/cpp03/tutorial/daytime4/client.cpp rename to asio/src/examples/cpp11/tutorial/daytime4/client.cpp index 5609abdede..76d6c702e2 100644 --- a/asio/src/examples/cpp03/tutorial/daytime4/client.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime4/client.cpp @@ -8,8 +8,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include -#include #include using asio::ip::udp; @@ -33,10 +33,10 @@ int main(int argc, char* argv[]) udp::socket socket(io_context); socket.open(udp::v4()); - boost::array send_buf = {{ 0 }}; + std::array send_buf = {{ 0 }}; socket.send_to(asio::buffer(send_buf), receiver_endpoint); - boost::array recv_buf; + std::array recv_buf; udp::endpoint sender_endpoint; size_t len = socket.receive_from( asio::buffer(recv_buf), sender_endpoint); diff --git a/asio/src/examples/cpp03/tutorial/daytime5/.gitignore b/asio/src/examples/cpp11/tutorial/daytime5/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime5/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime5/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime5/server.cpp b/asio/src/examples/cpp11/tutorial/daytime5/server.cpp similarity index 90% rename from asio/src/examples/cpp03/tutorial/daytime5/server.cpp rename to asio/src/examples/cpp11/tutorial/daytime5/server.cpp index 46d30db88e..8b4326fb02 100644 --- a/asio/src/examples/cpp03/tutorial/daytime5/server.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime5/server.cpp @@ -8,10 +8,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include #include #include -#include #include using asio::ip::udp; @@ -33,13 +33,13 @@ int main() for (;;) { - boost::array recv_buf; + std::array 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; + std::error_code ignored_error; socket.send_to(asio::buffer(message), remote_endpoint, 0, ignored_error); } diff --git a/asio/src/examples/cpp03/tutorial/daytime6/.gitignore b/asio/src/examples/cpp11/tutorial/daytime6/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime6/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime6/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime6/server.cpp b/asio/src/examples/cpp11/tutorial/daytime6/server.cpp similarity index 77% rename from asio/src/examples/cpp03/tutorial/daytime6/server.cpp rename to asio/src/examples/cpp11/tutorial/daytime6/server.cpp index f1f1c793f6..0c03d033e1 100644 --- a/asio/src/examples/cpp03/tutorial/daytime6/server.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime6/server.cpp @@ -8,12 +8,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include +#include #include +#include #include -#include -#include -#include #include using asio::ip::udp; @@ -39,21 +39,21 @@ class udp_server { socket_.async_receive_from( asio::buffer(recv_buffer_), remote_endpoint_, - boost::bind(&udp_server::handle_receive, this, + std::bind(&udp_server::handle_receive, this, asio::placeholders::error, asio::placeholders::bytes_transferred)); } - void handle_receive(const asio::error_code& error, + void handle_receive(const std::error_code& error, std::size_t /*bytes_transferred*/) { if (!error) { - boost::shared_ptr message( + std::shared_ptr message( new std::string(make_daytime_string())); socket_.async_send_to(asio::buffer(*message), remote_endpoint_, - boost::bind(&udp_server::handle_send, this, message, + std::bind(&udp_server::handle_send, this, message, asio::placeholders::error, asio::placeholders::bytes_transferred)); @@ -61,15 +61,15 @@ class udp_server } } - void handle_send(boost::shared_ptr /*message*/, - const asio::error_code& /*error*/, + void handle_send(std::shared_ptr /*message*/, + const std::error_code& /*error*/, std::size_t /*bytes_transferred*/) { } udp::socket socket_; udp::endpoint remote_endpoint_; - boost::array recv_buffer_; + std::array recv_buffer_; }; int main() diff --git a/asio/src/examples/cpp03/tutorial/daytime7/.gitignore b/asio/src/examples/cpp11/tutorial/daytime7/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/daytime7/.gitignore rename to asio/src/examples/cpp11/tutorial/daytime7/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/daytime7/server.cpp b/asio/src/examples/cpp11/tutorial/daytime7/server.cpp similarity index 76% rename from asio/src/examples/cpp03/tutorial/daytime7/server.cpp rename to asio/src/examples/cpp11/tutorial/daytime7/server.cpp index 22ef564b8b..23282dcf5f 100644 --- a/asio/src/examples/cpp03/tutorial/daytime7/server.cpp +++ b/asio/src/examples/cpp11/tutorial/daytime7/server.cpp @@ -8,13 +8,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include +#include #include +#include #include -#include -#include -#include -#include #include using asio::ip::tcp; @@ -28,10 +27,10 @@ std::string make_daytime_string() } class tcp_connection - : public boost::enable_shared_from_this + : public std::enable_shared_from_this { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; static pointer create(asio::io_context& io_context) { @@ -48,7 +47,7 @@ class tcp_connection message_ = make_daytime_string(); asio::async_write(socket_, asio::buffer(message_), - boost::bind(&tcp_connection::handle_write, shared_from_this())); + std::bind(&tcp_connection::handle_write, shared_from_this())); } private: @@ -82,12 +81,12 @@ class tcp_server tcp_connection::create(io_context_); acceptor_.async_accept(new_connection->socket(), - boost::bind(&tcp_server::handle_accept, this, new_connection, + std::bind(&tcp_server::handle_accept, this, new_connection, asio::placeholders::error)); } void handle_accept(tcp_connection::pointer new_connection, - const asio::error_code& error) + const std::error_code& error) { if (!error) { @@ -115,31 +114,31 @@ class udp_server { socket_.async_receive_from( asio::buffer(recv_buffer_), remote_endpoint_, - boost::bind(&udp_server::handle_receive, this, + std::bind(&udp_server::handle_receive, this, asio::placeholders::error)); } - void handle_receive(const asio::error_code& error) + void handle_receive(const std::error_code& error) { if (!error) { - boost::shared_ptr message( + std::shared_ptr message( new std::string(make_daytime_string())); socket_.async_send_to(asio::buffer(*message), remote_endpoint_, - boost::bind(&udp_server::handle_send, this, message)); + std::bind(&udp_server::handle_send, this, message)); start_receive(); } } - void handle_send(boost::shared_ptr /*message*/) + void handle_send(std::shared_ptr /*message*/) { } udp::socket socket_; udp::endpoint remote_endpoint_; - boost::array recv_buffer_; + std::array recv_buffer_; }; int main() diff --git a/asio/src/examples/cpp03/tutorial/daytime_dox.txt b/asio/src/examples/cpp11/tutorial/daytime_dox.txt similarity index 96% rename from asio/src/examples/cpp03/tutorial/daytime_dox.txt rename to asio/src/examples/cpp11/tutorial/daytime_dox.txt index c2cc0579f7..62e98f6c02 100644 --- a/asio/src/examples/cpp03/tutorial/daytime_dox.txt +++ b/asio/src/examples/cpp11/tutorial/daytime_dox.txt @@ -54,9 +54,9 @@ version. The asio::connect() function does this for us automatically. 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() +We use a std::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 +overruns. Instead of a std::array, we could have used a char [] or std::vector. \until read_some @@ -205,7 +205,7 @@ to keep the data valid until the asynchronous operation is complete. \until message_ -When initiating the asynchronous operation, and if using \ref boost_bind, you +When initiating the asynchronous operation, and if using @c std::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, @@ -236,7 +236,7 @@ just: \code asio::async_write(socket_, asio::buffer(message_), - boost::bind(&tcp_connection::handle_write, shared_from_this())); + std::bind(&tcp_connection::handle_write, shared_from_this())); \endcode See the \ref tutdaytime3src "full source listing" \n @@ -382,7 +382,7 @@ The function asio::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 asio::io_context object will invoke the handle_receive() function with two arguments: a value of type -asio::error_code indicating whether the operation succeeded or failed, and a +std::error_code indicating whether the operation succeeded or failed, and a size_t value bytes_transferred specifying the number of bytes received. @@ -408,7 +408,7 @@ client. \until asio::placeholders::bytes_transferred -When initiating the asynchronous operation, and if using \ref boost_bind, you +When initiating the asynchronous operation, and if using @c std::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. diff --git a/asio/src/examples/cpp03/tutorial/index_dox.txt b/asio/src/examples/cpp11/tutorial/index_dox.txt similarity index 100% rename from asio/src/examples/cpp03/tutorial/index_dox.txt rename to asio/src/examples/cpp11/tutorial/index_dox.txt diff --git a/asio/src/examples/cpp03/tutorial/timer1/.gitignore b/asio/src/examples/cpp11/tutorial/timer1/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/timer1/.gitignore rename to asio/src/examples/cpp11/tutorial/timer1/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/timer1/timer.cpp b/asio/src/examples/cpp11/tutorial/timer1/timer.cpp similarity index 100% rename from asio/src/examples/cpp03/tutorial/timer1/timer.cpp rename to asio/src/examples/cpp11/tutorial/timer1/timer.cpp diff --git a/asio/src/examples/cpp03/tutorial/timer2/.gitignore b/asio/src/examples/cpp11/tutorial/timer2/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/timer2/.gitignore rename to asio/src/examples/cpp11/tutorial/timer2/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/timer2/timer.cpp b/asio/src/examples/cpp11/tutorial/timer2/timer.cpp similarity index 92% rename from asio/src/examples/cpp03/tutorial/timer2/timer.cpp rename to asio/src/examples/cpp11/tutorial/timer2/timer.cpp index 27319d03cc..456176e811 100644 --- a/asio/src/examples/cpp03/tutorial/timer2/timer.cpp +++ b/asio/src/examples/cpp11/tutorial/timer2/timer.cpp @@ -11,7 +11,7 @@ #include #include -void print(const asio::error_code& /*e*/) +void print(const std::error_code& /*e*/) { std::cout << "Hello, world!" << std::endl; } diff --git a/asio/src/examples/cpp03/tutorial/timer3/.gitignore b/asio/src/examples/cpp11/tutorial/timer3/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/timer3/.gitignore rename to asio/src/examples/cpp11/tutorial/timer3/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/timer3/timer.cpp b/asio/src/examples/cpp11/tutorial/timer3/timer.cpp similarity index 84% rename from asio/src/examples/cpp03/tutorial/timer3/timer.cpp rename to asio/src/examples/cpp11/tutorial/timer3/timer.cpp index dcf1425767..bfb0e61fb1 100644 --- a/asio/src/examples/cpp03/tutorial/timer3/timer.cpp +++ b/asio/src/examples/cpp11/tutorial/timer3/timer.cpp @@ -8,11 +8,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include #include -#include -void print(const asio::error_code& /*e*/, +void print(const std::error_code& /*e*/, asio::steady_timer* t, int* count) { if (*count < 5) @@ -21,7 +21,7 @@ void print(const asio::error_code& /*e*/, ++(*count); t->expires_at(t->expiry() + asio::chrono::seconds(1)); - t->async_wait(boost::bind(print, + t->async_wait(std::bind(print, asio::placeholders::error, t, count)); } } @@ -32,7 +32,7 @@ int main() int count = 0; asio::steady_timer t(io, asio::chrono::seconds(1)); - t.async_wait(boost::bind(print, + t.async_wait(std::bind(print, asio::placeholders::error, &t, &count)); io.run(); diff --git a/asio/src/examples/cpp03/tutorial/timer4/.gitignore b/asio/src/examples/cpp11/tutorial/timer4/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/timer4/.gitignore rename to asio/src/examples/cpp11/tutorial/timer4/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/timer4/timer.cpp b/asio/src/examples/cpp11/tutorial/timer4/timer.cpp similarity index 84% rename from asio/src/examples/cpp03/tutorial/timer4/timer.cpp rename to asio/src/examples/cpp11/tutorial/timer4/timer.cpp index 6ef81f59ea..acdc4c349f 100644 --- a/asio/src/examples/cpp03/tutorial/timer4/timer.cpp +++ b/asio/src/examples/cpp11/tutorial/timer4/timer.cpp @@ -8,9 +8,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include #include -#include class printer { @@ -19,7 +19,7 @@ class printer : timer_(io, asio::chrono::seconds(1)), count_(0) { - timer_.async_wait(boost::bind(&printer::print, this)); + timer_.async_wait(std::bind(&printer::print, this)); } ~printer() @@ -35,7 +35,7 @@ class printer ++count_; timer_.expires_at(timer_.expiry() + asio::chrono::seconds(1)); - timer_.async_wait(boost::bind(&printer::print, this)); + timer_.async_wait(std::bind(&printer::print, this)); } } diff --git a/asio/src/examples/cpp03/tutorial/timer5/.gitignore b/asio/src/examples/cpp11/tutorial/timer5/.gitignore similarity index 100% rename from asio/src/examples/cpp03/tutorial/timer5/.gitignore rename to asio/src/examples/cpp11/tutorial/timer5/.gitignore diff --git a/asio/src/examples/cpp03/tutorial/timer5/timer.cpp b/asio/src/examples/cpp11/tutorial/timer5/timer.cpp similarity index 83% rename from asio/src/examples/cpp03/tutorial/timer5/timer.cpp rename to asio/src/examples/cpp11/tutorial/timer5/timer.cpp index f4f1f7172a..4470ec0ccc 100644 --- a/asio/src/examples/cpp03/tutorial/timer5/timer.cpp +++ b/asio/src/examples/cpp11/tutorial/timer5/timer.cpp @@ -8,9 +8,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include #include +#include #include -#include class printer { @@ -22,10 +23,10 @@ class printer count_(0) { timer1_.async_wait(asio::bind_executor(strand_, - boost::bind(&printer::print1, this))); + std::bind(&printer::print1, this))); timer2_.async_wait(asio::bind_executor(strand_, - boost::bind(&printer::print2, this))); + std::bind(&printer::print2, this))); } ~printer() @@ -43,7 +44,7 @@ class printer timer1_.expires_at(timer1_.expiry() + asio::chrono::seconds(1)); timer1_.async_wait(asio::bind_executor(strand_, - boost::bind(&printer::print1, this))); + std::bind(&printer::print1, this))); } } @@ -57,7 +58,7 @@ class printer timer2_.expires_at(timer2_.expiry() + asio::chrono::seconds(1)); timer2_.async_wait(asio::bind_executor(strand_, - boost::bind(&printer::print2, this))); + std::bind(&printer::print2, this))); } } @@ -72,7 +73,7 @@ int main() { asio::io_context io; printer p(io); - asio::thread t(boost::bind(&asio::io_context::run, &io)); + std::thread t([&]{ io.run(); }); io.run(); t.join(); diff --git a/asio/src/examples/cpp03/tutorial/timer_dox.txt b/asio/src/examples/cpp11/tutorial/timer_dox.txt similarity index 95% rename from asio/src/examples/cpp03/tutorial/timer_dox.txt rename to asio/src/examples/cpp11/tutorial/timer_dox.txt index 0ac88efc6d..778e94dbec 100644 --- a/asio/src/examples/cpp03/tutorial/timer_dox.txt +++ b/asio/src/examples/cpp11/tutorial/timer_dox.txt @@ -136,7 +136,7 @@ your handler function. \dontinclude timer3/timer.cpp \skip #include -\until bind.hpp +\until asio.hpp To implement a repeating timer using asio you need to change the timer's expiry time in your completion handler, and to then start a new @@ -171,19 +171,16 @@ whole-second mark due to any delays in processing the handler. \until expires_at Then we start a new asynchronous wait on the timer. As you can -see, the \ref boost_bind function is used to associate the extra parameters +see, the @c std::bind function is used to associate the extra parameters with your completion handler. The asio::steady_timer::async_wait() function expects a handler function (or function object) with the signature -void(const asio::error_code&). Binding the additional parameters +void(const std::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 \ref boost_bind. - -In this example, the asio::placeholders::error argument to \ref boost_bind is a +In this example, the asio::placeholders::error argument to @c std::bind is a named placeholder for the error object passed to the handler. When initiating -the asynchronous operation, and if using \ref boost_bind, you must specify only +the asynchronous operation, and if using @c std::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 completion handler. @@ -230,7 +227,7 @@ tutorial Timer.3. \dontinclude timer4/timer.cpp \skip #include -\until bind.hpp +\until asio.hpp Instead of defining a free function print as the completion handler, as we did in the earlier tutorial programs, we now define a @@ -244,13 +241,13 @@ counter used to shut down the program is now also a member of the class. \until { -The \ref boost_bind function works just as well with class +The @c std::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, \ref boost_bind +this to the function. As in tutorial Timer.3, @c std::bind converts our completion handler (now a member function) into a function object that can be invoked as though it has the signature void(const -asio::error_code&). +std::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 @@ -319,7 +316,7 @@ when handlers might be accessing a shared, thread-unsafe resource. \dontinclude timer5/timer.cpp \skip #include -\until bind.hpp +\until asio.hpp We start by defining a class called printer, similar to the class in the previous tutorial. This class will extend the previous diff --git a/asio/src/examples/cpp11/type_erasure/line_reader.hpp b/asio/src/examples/cpp11/type_erasure/line_reader.hpp index 6e95a8b699..4286a6265d 100644 --- a/asio/src/examples/cpp11/type_erasure/line_reader.hpp +++ b/asio/src/examples/cpp11/type_erasure/line_reader.hpp @@ -20,7 +20,7 @@ class line_reader { private: virtual void async_read_line_impl(std::string prompt, - asio::any_completion_handler handler) = 0; + asio::any_completion_handler handler) = 0; struct initiate_read_line { @@ -37,10 +37,10 @@ class line_reader template auto async_read_line(std::string prompt, CompletionToken&& token) -> decltype( - asio::async_initiate( + asio::async_initiate( initiate_read_line(), token, this, prompt)) { - return asio::async_initiate( + return asio::async_initiate( initiate_read_line(), token, this, prompt); } }; diff --git a/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp b/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp index 43418f7e45..430553d47b 100644 --- a/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp +++ b/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp @@ -19,14 +19,14 @@ stdin_line_reader::stdin_line_reader(asio::any_io_executor ex) } void stdin_line_reader::async_read_line_impl(std::string prompt, - asio::any_completion_handler handler) + asio::any_completion_handler handler) { std::cout << prompt; std::cout.flush(); asio::async_read_until(stdin_, asio::dynamic_buffer(buffer_), '\n', asio::deferred( - [this](asio::error_code ec, std::size_t n) + [this](std::error_code ec, std::size_t n) { if (!ec) { diff --git a/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp b/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp index 489e7d282c..5e680f3409 100644 --- a/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp +++ b/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp @@ -21,7 +21,7 @@ class stdin_line_reader : public line_reader private: void async_read_line_impl(std::string prompt, - asio::any_completion_handler handler) override; + asio::any_completion_handler handler) override; asio::posix::stream_descriptor stdin_; std::string buffer_; diff --git a/asio/src/examples/cpp03/allocation/.gitignore b/asio/src/examples/cpp11/windows/.gitignore similarity index 100% rename from asio/src/examples/cpp03/allocation/.gitignore rename to asio/src/examples/cpp11/windows/.gitignore diff --git a/asio/src/examples/cpp03/windows/transmit_file.cpp b/asio/src/examples/cpp11/windows/transmit_file.cpp similarity index 88% rename from asio/src/examples/cpp03/windows/transmit_file.cpp rename to asio/src/examples/cpp11/windows/transmit_file.cpp index 891ba81241..f0feb0a6d8 100644 --- a/asio/src/examples/cpp03/windows/transmit_file.cpp +++ b/asio/src/examples/cpp11/windows/transmit_file.cpp @@ -9,11 +9,10 @@ // #include +#include #include +#include #include -#include -#include -#include #include "asio.hpp" #if defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) @@ -47,7 +46,7 @@ void transmit_file(tcp_socket& socket, // The operation completed immediately, so a completion notification needs // to be posted. When complete() is called, ownership of the OVERLAPPED- // derived object passes to the io_context. - asio::error_code ec(last_error, + std::error_code ec(last_error, asio::error::get_system_category()); overlapped.complete(ec, 0); } @@ -60,10 +59,10 @@ void transmit_file(tcp_socket& socket, } class connection - : public boost::enable_shared_from_this + : public std::enable_shared_from_this { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; static pointer create(asio::io_context& io_context, const std::string& filename) @@ -78,13 +77,13 @@ class connection void start() { - asio::error_code ec; + std::error_code ec; file_.assign(::CreateFile(filename_.c_str(), GENERIC_READ, 0, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, 0), ec); if (file_.is_open()) { transmit_file(socket_, file_, - boost::bind(&connection::handle_write, shared_from_this(), + std::bind(&connection::handle_write, shared_from_this(), asio::placeholders::error, asio::placeholders::bytes_transferred)); } @@ -98,10 +97,10 @@ class connection { } - void handle_write(const asio::error_code& /*error*/, + void handle_write(const std::error_code& /*error*/, size_t /*bytes_transferred*/) { - asio::error_code ignored_ec; + std::error_code ignored_ec; socket_.shutdown(tcp_socket::shutdown_both, ignored_ec); } @@ -128,12 +127,12 @@ class server connection::create(acceptor_.get_executor().context(), filename_); acceptor_.async_accept(new_connection->socket(), - boost::bind(&server::handle_accept, this, new_connection, + std::bind(&server::handle_accept, this, new_connection, asio::placeholders::error)); } void handle_accept(connection::pointer new_connection, - const asio::error_code& error) + const std::error_code& error) { if (!error) {