BSD Sockets Interface Programmer's Guide

Chapter 2 29
Using Internet Stream Sockets
Overview
Overview
Internet TCP stream sockets provide bidirectional, reliable, sequenced
and unduplicated flow of data without record boundaries. The following
table lists the steps involved in creating and terminating a BSD Sockets
connection using stream sockets.
Table 2-1 Creating/Terminating BSD Sockets Connections Using Internet
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
(optional)
bind() 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()