|
SVCS - English Documentation
|
Handles the remote communication protocol for SVCS. More...
#include <RemoteProtocol.hxx>
Public Member Functions | |
| RemoteProtocol (std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repository_manager) | |
| Constructs a RemoteProtocol with necessary dependencies. | |
| ~RemoteProtocol ()=default | |
| Default destructor. | |
| bool | handleReceivePack () |
| Handles the 'receive-pack' protocol for push operations. | |
| bool | handleUploadPack () |
| Handles the 'upload-pack' protocol for pull operations. | |
Handles the remote communication protocol for SVCS.
Manages the custom protocol for push and pull operations, including object negotiation, data transfer, and reference updates between client and server. The protocol is a simple text-based exchange over standard input/output.
| svcs::server::RemoteProtocol::RemoteProtocol | ( | std::shared_ptr< ISubject > | event_bus, |
| std::shared_ptr< RepositoryManager > | repository_manager ) |
Constructs a RemoteProtocol with necessary dependencies.
| event_bus | The shared pointer to the event bus for the notification system (ISubject). |
| repository_manager | The shared pointer to the repository manager for repository operations (RepositoryManager). |
| bool svcs::server::RemoteProtocol::handleReceivePack | ( | ) |
Handles the 'receive-pack' protocol for push operations.
This function processes client push requests. It manages the negotiation of objects, receives the missing object data from the client, and finally attempts to apply the requested reference updates (e.g., updating branches).
| bool svcs::server::RemoteProtocol::handleUploadPack | ( | ) |
Handles the 'upload-pack' protocol for pull operations.
This function processes client pull requests. It performs object negotiation by determining which objects the client is missing based on its 'have' list, and then packages and sends the missing object data to the client.