On a high level, this is my understanding of the difference between a client and server:a server listens on a host and a port, receives requests (e.g. through a socket connection), and then sends a response to the client who initiated the socket connection.The client is what sends a request to that server socket, and waits for a response.The definition is a bit broad and vague. Here is two situations in which both clients subscribe to the above definition, but behave differently:1) In the first example, the program assumes a socket server is listening on port 2000. This client makes a tcp connection to socket server, waits for response, then prints the response to stdout of the currently running process, and closes connection. It itself does not write anything to the server:require 'socket'host, port = ARGVs = TCPSocket.open(host, port)while line = s.gets  puts the data is #{line.chop} ends.closeThe socket server it talks to accepts tcp connections on port 2000. Once a connection is established, it sends data back to client, and then closes the socket thereby terminating connection with the client:require 'socket'server = TCPServer.open(2000)loop {   client = server.accept   client.puts(Time.now.ctime)   client.close}Ok so the client program in the above example subscribes to the original definition delineated for client.But in the next example, the client behaves differently. The clients establishes a tcp connection to a running instance of a redis socket server. The client creates a TCP socket connection to redis-server on port 6379 (the default redis port), plus establishes the new unified request protocol (redis protocol specification) - allowing the connection to communicate using redis-specific format messaging (e.g. multi-bulk replies). Just like the other client, this client sends a request to the server socket for a tcp connection, and waits for a response. However, unlike the other example, this clients writes data to the server. Redis implement the Publish/Subscribe messaging paradigm. The client publishes to a channel which is stored in the key/value store on main memory that redis supports. So this client behaves significantly different from the other in that it just doesn't simply wait for some kind of response, it writes to the server and causes the server to do things, like push data to subscribed clients.    require 'rubygems'require 'redis'require 'json'redis = Redis.newdata = {user => ARGV[1]}loop do  msg = STDIN.gets  output = redis.publish ARGV[0], data.merge('msg' => msg.strip).to_json  puts What output we get #{output}endSo I am wondering if someone could give me a more comprehensive definition of client and server. 
Difference between a server and a client
client server
The client and server are basically two parts of a distributed computing model.In this model, a user uses a client computer which sends requests to the server. The server then processes the request and creates the appropriate response which it sends back to the client. In this model, it is often the client that initiates the interaction and not the server. The server simply waits for requests to be serviced.In the two examples that you gave above,First example, signifies the simple Request-Response operation.Second Example, implies the Client sends the request, does some transactions/operations and the sends the Response, (Successful or Failure.)So it does send the response, in the second example.In Summary:A Server services the requests from the client.The client is usually the initiator.A single server accommodates multiple clients.The server is responsible for the data processing/operations while the client handles the presentation.Let me know if it helped. 