Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.99 KB

Prog6read.md

File metadata and controls

65 lines (41 loc) · 1.99 KB

Program 6 - Echo client/Server

TOC

Program Description

The communication process is this minimal orocess:

  1. Client sends string size to server
  2. Client sends string to server
  3. Server sends string back to client

The iterative and concurrent versions share the same client (As it is a design of the server)

Iterative

The server maintains one thread and responds with it. Multiple requests are queued for response, and dealt with in a FIFO manner.

Output

Client incorrect address

Two cases are shown here:

  1. Client cannot connect as server isn't running
  2. Insufficient arguments provided

Incorrect client

Successful echos

It can be seen that all the processes share the same pid, showing that the same process is being used

Successful echoes

Concurrent

The server forks to respond to the client. Additionally, a signal handler needs to be present, to remove the exit child processes after they have responded to the client.

Output

Client incorrect address

Two cases are shown here:

  1. Client cannot connect as server isn't running
  2. Insufficient arguments provided

Incorrect client

Successful communication

The different pids depict that the process forks in order to respond. This allows multiple clients to connect to the server and communicate with it at the same time.

Concurrent successful