O'Reilly logo

Linux Socket Programming by Example by Warren W. Gay

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

Chapter 4. Socket Types and Protocols

In Chapter 1, "Introducing Sockets," you saw how the socketpair(2) function was used to create a pair of local sockets. In this chapter, you will also learn about the socket(2) function to create a socket. These two functions have the domain, the socket type, and the protocol ingredients in common.

This chapter will build on the previous chapters by primarily focusing on the socket(2) function call. This includes expanding upon the following:

  • The domain argument

  • The socket type argument

  • The protocol argument

Specifying the Domain of a Socket

In Chapter 1, you read that for the socketpair(2) function, the domain argument must be the value AF_LOCAL or AF_UNIX (remember, these were equivalent). Then in Chapter 2, you ...

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