HPlogo HP 9000 Networking: BSD Sockets Interface Programmer's Guide > Chapter 6 Using UNIX Domain Stream Sockets

Overview

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

UNIX Domain (AF_UNIX) stream sockets provide bidirectional, reliable, unduplicated flow of data without record boundaries. They offer significant performance increases when compared with the use of local internet (AF_INET) sockets, due primarily to lower code execution overhead. The following table lists the steps involved in creating and terminating a UNIX Domain BSD Sockets connection using stream sockets.

Table 6-1 Creating/Terminating BSD Sockets Connections Using UNIX Domain Stream Sockets

Client Process Activity

System Call Used

Server Process Activity

System Call Used

create a socket

socket()

create a socket

socket()

bind a socket address

bind()

listen for incoming connection requests

listen()

request a connection

connect()

accept connection

accept()

send data

write() or send()

receive data

read() or recv()

send data

write() or send()

receive data

read() or recv()

disconnect socket (optional)

shutdown() or close()

disconnect socket (optional)

shutdown() or close()

 

Each of these steps or activities is described in more detail in the following sections. The description of each activity specifies a system call and includes:

  • What happens when the system call is used.

  • When to make the call.

  • What the parameters do.

  • How the call interacts with other BSD Sockets system calls.

  • Where to find details on the system call.

The UNIX Domain stream socket program examples are at the end of these descriptive sections. You can refer to the example code as you work through the descriptions.

© 1997 Hewlett-Packard Development Company, L.P.