09-05-2013, 12:50 PM
CLIENT SERVER PROGRAMMING
CLIENT SERVER PROGRAMMING.pdf (Size: 254.73 KB / Downloads: 19)
Introduction
Previous chapters describe the client-server model of interaction for
communicating programs and discuss the relationship between concurrency and
communication. This chapter considers general properties of the interface an
application program uses to communicate in the client-server model. The following
chapter illustrates these properties by giving details of a specific interface.
Loosely Specified Protocol Software Interface
In most implementations. TCP/IP protocol software is part of the
computer's system software. Thus, whenever an application program uses
TCP/IP to communicate. it must interact with the system software to
request service. From a programmer's point of view, the set of facilities
that the system supplies defines an Applicalion Program Interface or AP1.
TCP/IP was designed to operate in a multi-vendor environment.
To remain compatible with a wide variety of machines, TCP/IP
designers carefully avoided choosing any vendor's internal data
representation. In addition, the TCP/IP standards carefully avoid
specifying an API that uses features available only on a single vendor's
computer system. Thus, the interface between TCP/IP and applications
that use it has been looseiy specified. In other words:
The TCP/IP standards do not specify the details of how
application software interfaces with TCP/IP protocol software;
they only suggest the required functionuliry, and allow system
designers to choose the details when creating an API.
Advantages And Disadvantages
Using a loose specification for the protocol interface has advantages
and disadvantages. On the positive side, it provides flexibility and
tolerance. It allows designers to implement TCP/IP using operating
systems that range from the simplest systems available on personal
computers to the sophisticated systems used on supercomputers.
Implementation Of An API
All implementations of a particular API appear the same to
programmers: the API merely consists of a set of procedures (or
functions) that an application program can call to establish
communication or to send and receive data. In practice, however,
the implementation of the AP[ depends on the underlying
system. For example, early software systems designed for
personal computers did not include an operating system in the
conventional sense. On such systems, procedures in the API were
handled like any other library procedures - a copy of APi
procedures that an application called were linked into the
application program along with the TCP/IP code that was needed.
More sophisticated computer systems can load more than
one application into memory simultaneously. On such systems,
linking a separate copy of networking code into each application
does not make sense. Instead, a single copy of the code is placed in
memory, where it is shared by all applications. The exact
implementation of sharing depends on the computer's software
system. The code might reside in the computer's operating system.