How giovaneps/arquivos-distribuidos works
The daemon
• Located in the “daemon” directory, this is the server component responsible for receiving files, managing concurrent transfers, applying transfer rate limits, and handling partial file transfers (using the .part extension as described).
• It likely uses Berkeley Sockets for network communication and manages incoming connections from multiple clients.
The remcp tool
• Found in the “remcp” directory, this client component is used to send and receive files. It prepares the network request, handles file transfers (including checking for partial transfers and resuming as needed), and interacts with the server daemon.
• The “utils” subdirectory suggests that common helper functions are implemented for file operations or network handling.
Additionally, the “relatorio” directory contains report files (PDF, LaTeX) that document the system and probably provide further context for the implemented design, while “INE5645_trabalho2.pdf” and README serve as project documentation.
Main Components
• Client (remcp):
• Command-line interface (CLI) entry point for file transfer actions.
• File handling module to check local files, create or update temporary “.part” files.
• Network module that establishes a connection to the remote daemon using Berkeley Sockets.
• Server (daemon):
• Network listener that accepts incoming file transfer requests.
• Transfer management system that supports multiple simultaneous clients and enforces a configurable transfer rate limit.
• File receiver that handles incoming data, saves to temporary “.part” files, and renames them once transfer is complete.
• Network Infrastructure:
• Underlying communication using Berkeley Sockets.
• Directional data flows between client and server.
Relationships and Interactions
• The remcp client initiates a connection to the server daemon over the network.
• Data flows inbound from the client to the daemon when sending files, and vice versa when receiving.
• The client checks for and handles partial file transfers by verifying the existence of “.part” files, then sends only the remaining data.
• The server concurrently manages multiple connections by allocating specific portions of the overall rate limit to each client.
Architectural Patterns and Design Principles
• Modularity: The project cleanly separates the client and server functionalities into different directories (remcp and daemon), which suggests a layered architecture.
• Concurrency: The daemon is designed to handle multiple clients concurrently, so consider showing a “connection manager” or “thread pool” abstraction.
• Resilience: The use of temporary “.part” files to handle interruptions and resume transfers indicates the importance of fault tolerance.
• Network abstraction: Leveraging Berkeley Sockets as the base for distributed, socket-based communication.
Relevant Technologies and Frameworks
• The programming language is Go (as shown by the *.go files and go.mod), so you may wish to note Go’s routines for concurrency and network libraries.
• Mention that the system is designed to work with Unix-based file paths and environments.