Skip to content

EricLego/project1paralleldistributed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project 1 – Countdown Protocol (Python)

This repository now provides a Python implementation of the countdown protocol described in Project 1, Phase 1. The system exposes iterative and concurrent TCP server suites that follow a three-tier design.

Repository structure

src/main/python/countdown/
  service.py             # Application-tier countdown business logic
  common/                # Infrastructure components shared by servers
  iterative/             # Iterative server and client implementations
  concurrent/            # Concurrent server and client implementations
docs/                    # Architecture report and sample output transcripts

Running

All commands assume you are in the repository root, have Python 3.11+, and set PYTHONPATH=src/main/python so the modules can be imported.

Iterative server and client

Open two terminals.

  1. Start the server (default host 0.0.0.0, port 5000):
    PYTHONPATH=src/main/python python -m countdown.iterative.server 5000 0.0.0.0
  2. Run the client with a positive integer argument:
    PYTHONPATH=src/main/python python -m countdown.iterative.client 5 localhost 5000

Use --max-clients on the server to exit automatically after serving a fixed number of requests.

Concurrent server and client

  1. Start the server (default host 0.0.0.0, port 5001):
    PYTHONPATH=src/main/python python -m countdown.concurrent.server 5001 0.0.0.0 --max-workers 4
  2. Run the client:
    PYTHONPATH=src/main/python python -m countdown.concurrent.client 4 localhost 5001

Override host/port as needed. The concurrent server spawns a thread for each client connection (bounded by --max-workers when provided).

Testing

Sample command transcripts are stored in docs/sample-output.md and were generated by running the commands above.

Deliverables

About

Client-server countdown protocol project: client sends integer n n; server replies with countdown n n to 1. Implement iterative and concurrent connection-oriented versions in Java using a three-tier design. Submit code, brief report, and output screenshots.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages