Chapter 8. Making Connections
Chapter 7 explained how to identify a host on the network and a service on that host. In this chapter, we learn how to connect with the host and access the service once they are identified. We discuss the Transmission Control Protocol (TCP) and the Internet Protocol (IP). IP is dedicated to moving individual packets of data from sender to receiver across the network. TCP provides a virtual connection on top of IP, where data is received in the order in which it was sent, with no gaps.
I also discuss the Sockets API, a consistent, easy-to-use programming interface to network services across many platforms, operating systems, and networks. The Palm OS Net Library interface is loosely based on the Berkeley Sockets interface, with allowances for the special needs and constraints of the Palm execution environment. In this chapter, I cover connecting and disconnecting sockets. In Chapter 9, I discuss exchanging data across socket connections.
What Is a Connection?
A connection is like a phone call. A process running on one host decides to call a process running on another host. Instead of phone numbers, network connections need IP addresses; instead of asking for a specific person, network connections request a specific port. In Chapter 7, we learn how to obtain the network address for a host and the port number for a service. In this chapter, we open and close a connection to this host service.
A connection is a link between two processes. These processes ...