private void StartPeer(int port) { string peerListName = Config.PeerListFilePath; // Initialize anti entropy protocol vc = new VersionControl(); protocol = new AntiEntropyProtocol(port, peerListName, vc); // Initialize file watcher FileWatcher watcher = new FileWatcher(); watcher.Created += vc.Created; watcher.Changed += vc.Changed; watcher.Deleted += vc.Deleted; watcher.Renamed += vc.Renamed; watcher.Idle += vc.Flush; }
/// <summary> /// Accept the specified visitor and peer. /// </summary> /// <param name="visitor">The Visitor.</param> /// <param name="peer">The Peer.</param> /// <exception cref="NotImplementedException">Is thrown when a requested operation is not implemented for a given type.</exception> public override void Accept(AntiEntropyProtocol visitor, Peer peer) { visitor.Process(this, peer); }