Client/Server Applications Made Easy - Client and Server Applications
(Page 2 of 4 )
The Client Application
So how does a client work? As I have stated before, the client basically makes requests to a server and then waits for a response, which it then interprets and displays. Now, how does the client know where the server is located? Well, for a client to connect to a server, it needs two things, the IP address and the port number.
The IP address tells the client where the server is located. A server can be located on the same machine, on a local network, or on the Internet. In other words, it could be located anywhere on the planet. Wherever the server is running, it will have an IP address and that is the only way a client can ID and connect to a server. As for the port number, that is where the server "listens" for connections. A port number is what the server uses to send and receive messages.
The Server Application
The server processes request made by a client and responds to the client. That is the core function of any server. Servers are generally passive as they wait for a client request.
Unlike clients, servers must run continually because a client can send a request at any time. Clients, on the other hand, don't have to run continually. They only need to be running when they require a service.
Many server applications allow for multiple clients to request a service. For example, while you are reading this page, others interested in this article could also request and read the same web page.
TCP/IP
The client-server architecture is heavily dependent on TCP/IP. TCP/IP stands for Transmission Control Protocol / Internet Protocol. It is a set of protocols that enables communication across networks and the Internet. Basically, TCP/IP is a family of protocols that includes FTP, email (SMTP/POP3 etc), TELNET, and so forth. It sets the rules for how one computer communicates with another on a network and more importantly, defines how a unit of data should look and what information it should contain so that a receiving computer can interpret the message correctly.
I've been using the terms "data" and "packet" interchangeably. Basically the term "packet" is TCP/IP speak for data. TCP/IP and its related protocols form a complete system that defines how data should be processed, transmitted, and received on a TCP/IP network.

TCP/IP is a connection-oriented protocol that transfers data from one socket to another as an unstructured stream of bytes. A socket is created when you have a port number and IP address. You need to have two or more computers in a TCP/IP network for TCP/IP to work. You will also need software that is capable of interpreting and responding to data. For the purposes of this article we need to cover the following:
- How a computer is identified on a network (or on the Internet).
- How we can be sure that requests made by our client applications are going to be received by the server.
- How our application is supported by the Internet or network.
TCP/IP addresses these issues through:
- Logical Addressing
- Routing
- Name Resolution
- Error Control and Flow Control
- Application Support
Although all of the above are relevant to client/server architecture, we are only going to explore Logical Addressing, Name Resolution, Error and Flow Control and Application Support as they are more relevant to the aim of the article.
Next: Logical Addressing and Name Resolution >>
More Delphi-Kylix Articles
More By Leidago