It is important to remember that the terms “client” and “server” apply to individual processes, and not individual machines. There can be multiple processes running on the same machine. It is also possible to have both clients and servers living on the same machine.
A “client” is a process (a program being executed) that initiates requests. In other words, in a client/server connection, it is always the case that a client starts a transaction, and not the server.
A “server” is a process that responds to requests initiated by a client.
It is possible to have a process that is both a client and a server. For example, most peer-to-peer (P2P) applications are hybrids.
A “socket” is a specific term referring to an established TCP (transport-control protocol) connection. Not all client-server protocols are socket-based. Some are UDP (user datagram protocol) based at the IP (internet protocol) level. However, it is fair to say that most client-server protocols are built on top of sockets.
HTTP (HyperText Transport Protocol) is a client-server protocol. The common name of the client is a “browser”, such as Mozilla, Firefox, Opera and Internet Explorer. The server can be a variety of server programs running on a variety of platforms. For example, Apache is an HTTP server program that can run on top of most Unix-like operating systems and Windows.
FTP (File Transport Protocol) is a client-server protocol. The client is a program that requests a user to enter username and password.
Telnet, like FTP, is a client-server protocol.
A “host” is just a computer. Why do we want to run both the client and server processes on the same machine?