Book Image

Learning Boost C++ Libraries

By : Arindam Mukherjee
Book Image

Learning Boost C++ Libraries

By: Arindam Mukherjee

Overview of this book

Table of Contents (19 chapters)
Learning Boost C++ Libraries
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Self-test questions


For multiple choice questions, choose all options that apply:

  1. What is the difference between io_service::dispatch and io_service::post?

    a. dispatch returns immediately while post runs the handler before returning

    b. post returns immediately while dispatch may run the handler on the current thread if it can, or it behaves like post

    c. post is thread-safe while dispatch is not

    d. post returns immediately while dispatch runs the handler

  2. 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 throw

    d. The io_service is stopped

  3. 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...