How sotheasokea/multi-threaded-file-download-client-server works
This is a Java TCP file-download client/server. The client queries the server for a file listing and size, downloads byte ranges into a local file, and checks size and SHA-256; the server handles concurrent connections and serves listing, metadata, and range requests from a shared directory. Traditional socket I/O and NIO transfer are optional modes. The client currently configures one range despite providing range-splitting and parallel-worker logic. Relationships reflect the sampled source and README; the shared directory is configured in the server, while its contents are external.
Main entry points: Client.java Download workflow · Server.java Command handler · TestServerSide.java Server test client
Components 12
Client
- Download workflow
MultithreadFileDownload/src/Client.java - Range planner
MultithreadFileDownload/src/Client.java - Download workers
MultithreadFileDownload/src/Client.java - Downloaded file
MultithreadFileDownload/src/Client.java - Download verification
MultithreadFileDownload/src/Client.java
Server
- Connection listener
MultithreadFileDownload/src/Server.java - Command handler
MultithreadFileDownload/src/Server.java - Shared files
MultithreadFileDownload/src/Server.java - Traditional transfer
MultithreadFileDownload/src/Server.java - NIO transfer
MultithreadFileDownload/src/Server.java
Other components
- User
- Server test client
MultithreadFileDownload/src/TestServerSide.java
Connections 13
- User → Download workflow: requests download
MultithreadFileDownload/src/Client.java - Download workflow → Connection listener: requests LIST, INFO
MultithreadFileDownload/src/Client.java - Download workflow → Range planner: calculates ranges
MultithreadFileDownload/src/Client.java - Download workflow → Download workers: starts downloads
MultithreadFileDownload/src/Client.java - Download workers → Connection listener: requests GET ranges
MultithreadFileDownload/src/Client.java - Download workers → Downloaded file: writes ranges
MultithreadFileDownload/src/Client.java - Download workflow → Download verification: checks download
MultithreadFileDownload/src/Client.java - Download verification → Downloaded file: reads and hashes
MultithreadFileDownload/src/Client.java - Connection listener → Command handler: dispatches connections
MultithreadFileDownload/src/Server.java - Command handler → Shared files: lists and reads
MultithreadFileDownload/src/Server.java - Command handler → Traditional transfer: streams bytes
MultithreadFileDownload/src/Server.java - Command handler → NIO transfer: transfers bytes
MultithreadFileDownload/src/Server.java - Server test client → Connection listener: sends test requests
MultithreadFileDownload/src/TestServerSide.java