Skip to main content

Module net

Module net 

Source
Expand description

Remote sync over a single duplex byte stream (ssh, or an in-process pipe).

Both peers are ripsync. One side is the initiator (the locally-invoked ripsync, which spawns ssh host ripsync --server); the other is the responder (ripsync --server). After a versioned handshake the connection carries the receiver-driven lock-step protocol described in proto.

Role mapping:

  • proto::Role::Push — local → remote: local is the sender, the remote server is the receiver.
  • proto::Role::Pull — remote → local: the remote server is the sender, local is the receiver.

Re-exports§

pub use proto::MAGIC;
pub use receiver::run_receiver;
pub use sender::run_sender;
pub use transport::IoDuplex;
pub use transport::duplex_pair;

Modules§

proto
Wire types for the ripsync↔ripsync remote-sync protocol.
receiver
The receiver: the side that holds the destination tree.
sender
The sender: the side that holds the source tree.
server
The ripsync --server peer: speaks the protocol over stdin/stdout.
transport
Framing and byte-stream plumbing for the remote protocol.

Functions§

run_initiator
Drive a remote sync from the local (initiator) side over an established connection. local_root is the local path; remote_root is the path on the peer. Returns the final Stats (for push, these come back from the remote receiver via Msg::Finished).
run_responder
Drive the responder side over an established connection: perform the responder handshake, then play the opposite role to the initiator. Used by ripsync --server (over stdio) and by tests (over an in-process pipe).