O'Reilly logo

Boost.Asio C++ Network Programming Cookbook by Dmytro Radchuk

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting and setting socket options

The socket's properties and its behavior can be configured by changing the values of its various options. When the socket object is instantiated, its options have default values. In many cases, the socket configured by default is a perfect fit, whereas in others, it may be needed to fine tune the socket by changing values of its options so that it meets the requirements of the application.

In this recipe, we will see how to get and set socket options with Boost.Asio.

Getting ready…

This recipe assumes familiarity with the content provided in Chapter 1, The Basics.

How to do it…

Each socket option, whose value can be set or obtained by means of a functionality provided by Boost.Asio, is represented by a separate class. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required