O'Reilly logo

Boost.Asio C++ Network Programming by John Torjo

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

Boost.Asio POSIX features

The features that follow apply only on Unix operating systems.

Local sockets

Boost.Asio provides basic support for local sockets (also known as Unix domain sockets).

A local socket is a socket that can only be accessed from the applications that run on the host machine. You can use local sockets for easy inter-process communication. You can connect both as a client socket or as a server socket. For local sockets, the endpoint is a filename, such as /tmp/whatever. One cool thing is that you can assign rights to that given file, and therefore, disallow certain users on your machine from creating a socket to the file.

You can connect as a client socket, as given in the following code snippet:

local::stream_protocol::endpoint ...

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