Boost.Asio C++ Network Programming - Second Edition
eBook - ePub

Boost.Asio C++ Network Programming - Second Edition

Wisnu Anggoro, John Torjo

Partager le livre
  1. 200 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Boost.Asio C++ Network Programming - Second Edition

Wisnu Anggoro, John Torjo

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Learn effective C++ network programming with Boost.Asio and become a proficient C++ network programmer

About This Book

  • Learn efficient C++ network programming with minimum coding using Boost.Asio
  • Your one-stop destination to everything related to the Boost.Asio library
  • Explore the fundamentals of networking to choose designs with more examples, and learn the basics of Boost.Asio

Who This Book Is For

This book is for C++ Network programmers with basic knowledge of network programming, but no knowledge of how to use Boost.Asio for network programming.

What You Will Learn

  • Prepare the tools to simplify network programming in C++ using Boost.Asio
  • Explore the networking concepts of IP addressing, TCP/IP ports and protocols, and LAN topologies
  • Get acquainted with the usage of the Boost libraries
  • Get to know more about the content of Boost.Asio network programming and Asynchronous programming
  • Establish communication between client and server by creating client-server application
  • Understand the various functions inside Boost.Asio C++ libraries to delve into network programming
  • Discover how to debug and run the code successfully

In Detail

Boost.Asio is a C++ library used for network programming operations.

Organizations use Boost because of its productivity. Use of these high-quality libraries speed up initial development, result in fewer bugs, reduce reinvention-of-the-wheel, and cut long-term maintenance costs. Using Boost libraries gives an organization a head start in adopting new technologies.

This book will teach you C++ Network programming using synchronous and asynchronous operations in Boost.Asio with minimum code, along with the fundamentals of Boost, server-client applications, debugging, and more.

You will begin by preparing and setting up the required tools to simplify your network programming in C++ with Boost.Asio. Then you will learn about the basic concepts in networking such as IP addressing, TCP/IP protocols, and LAN with its topologies. This will be followed by an overview of the Boost libraries and their usage.

Next you will get to know more about Boost.Asio and its concepts related to network programming. We will then go on to create a client-server application, helping you to understand the networking concepts. Moving on, you will discover how to use all the functions inside the Boost.Asio C++ libraries. Lastly, you will understand how to debug the code if there are errors found and will run the code successfully.

Style and approach

An example-oriented book to show you the basics of networking and help you create a network application simply using Boost.Asio, with more examples for you to get up and running with Boost.Asio quickly.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Boost.Asio C++ Network Programming - Second Edition est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Boost.Asio C++ Network Programming - Second Edition par Wisnu Anggoro, John Torjo en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Computer Networking. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2015
ISBN
9781785283079
Édition
2

Boost.Asio C++ Network Programming Second Edition


Table of Contents

Boost.Asio C++ Network Programming Second Edition
Credits
About the Authors
Acknowledgements
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Simplifying Your Network Programming in C++
Setting up the MinGW compiler and Text Editor
Installing MinGW-w64
Setting up the Path environment
Choosing and installing the Text Editor
Using the GCC C++ compiler
Compiling a C++ program
Compiling multiple source files
Compiling and linking a program separately
Detecting a warning in the C++ program
Knowing other important options in the GCC C++ compiler
Troubleshooting in the GCC C++ compiler
Help for command-line options
Version numbers
The verbose compilation
Summary
2. Understanding the Networking Concepts
An introduction to networking systems
The OSI reference model
The Physical layer
The Data Link layer
The Network layer
The Transport layer
The Session layer
The Presentation layer
The Application layer
The TCP/IP reference model
Understanding TCP and UDP
Transmission Control Protocol
User Datagram Protocol
Understanding ports
Exploring the Internet Protocol
Internet Protocol Version 4 – IPv4
Internet Protocol Version 6 – IPv6
Using TCP/IP tools for troubleshooting
The ipconfig command
Displaying the full configuration information
Displaying DNS
Flushing DNS
Renewing the IP address
Releasing the IP address
The ping command
The tracert command
The pathping command
The netstat command
The telnet command
Summary
3. Introducing the Boost C++ Libraries
Introducing the C++ standard template library
Introducing the Boost C++ libraries
Advantages of Boost libraries
Preparing Boost libraries for the MinGW compiler
Downloading Boost libraries
Deploying Boost libraries
Using Boost libraries
Building Boost libraries
Summary
4. Getting Started with Boost.Asio
Getting closer to the Boost.Asio library
Examining the I/O service in the Boost.Asio library
Using and blocking the run() function
Using the non-blocking poll() function
Removing the work object
Dealing with many threads
Understanding the Boost.Bind library
Wrapping a function invocation
Working with the Boost.Bind library
Synchronizing data access with the Boost.Mutex library
Giving some work to the I/O service
Using the post() function
Using the dispatch() function
Summary
5. Delving into the Boost.Asio Library
Serializing the I/O service work
Using the strand function
Wrapping a handler through the strand object
Handling exceptions and errors
Handling an exception
Handling an error
Timing the work execution using the timer class
An expiring timer
Using the timer along with the boost::bind function
Using the timer along with the boost::strand function
Summary
6. Creating a Client-server Application
Establishing a connection
A synchronous client
An asynchronous client
An asynchronous server
Reading and writing to the socket
The Send() and OnSend() functions
The Recv() and OnRecv() functions
Wrapping the network code
Developing a client and server program
Creating a simple echo server
Creating a simple client program
Summary
7. Debugging the Code and Solving the Error
Choosing a debugging tool
Installing a debugging tool
Preparing a file for debugging
Running the program under GDB
Starting the debugging process
The continuing and stepping debugging process
Printing the source code
Setting and deleting the breakpoint
Printing a variable value
Modifying a variable value
Calling the command prompt
Solving the error
What's next?
Summary
Index

Boost.Asio C++ Network Programming Second Edition

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: February 2013
Second published: September 2015
Production reference: 1100915
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-307-9
www.packtpub.com

Credits

Authors
Wisnu Anggoro
John Torjo
Reviewers
Toma Becea
Iyed Bennour
Vic Taylor
Commissioning Editor
Veena Pagare
Acquisition Editor
Tushar Gupta
Content Development Editor
Rashmi Suvarna
Technical Editor
Abhishek R. Kotian
Copy Editor
Neha Vyas
Project Coordinator
Judie Jose
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda

About the Authors

Wisnu Anggoro is a Microsoft Certified Professional in C# programming and an experienced C/C++ developer. He has been programming since he was in junior high school, and he started developing computer applications using basic programming in the MS-DOS environment. He has good experience in smart card programming as well as desktop and web application programming, such as designing, developing, and supporting live use applications for SIM Card Operating System Porting, personalization, PC/SC communication, and other smart card applications tha...

Table des matiĂšres