Self-test questions
For multiple choice questions, choose all options that apply:
- What is the difference between
io_service::dispatch
andio_service::post
?a.
dispatch
returns immediately whilepost
runs the handler before returningb.
post
returns immediately whiledispatch
may run the handler on the current thread if it can, or it behaves like postc.
post
is thread-safe whiledispatch
is notd.
post
returns immediately whiledispatch
runs the handler - What happens if a handler throws an exception when it is dispatched?
a. It is undefined behavior
b. It terminates the program with a call to
std::terminate
c. The call to run, on the
io_service
that dispatched the handler, will throwd. The
io_service
is stopped - What is the role of the unspecified address 0.0.0.0 (IPv4) or ::/1 (IPv6)?
a. It is used to communicate with local services on a system
b. Packets sent to this address are echoed back to the sender
c. It is used to broadcast to all connected hosts in the network
d. It is used to bind to all available...