Exemple #1
0
        /// <summary>
        /// Starts the peer service.
        /// </summary>
        /// <param name='port'>
        /// Listening port of the peer.
        /// </param>
        private static void StartPeer(int port)
        {
            string peerListName = Config.PeerListFilePath;

            // Initialize anti entropy protocol
            var vs = new VersionControl();
            protocol = new AntiEntropyProtocol(port, peerListName, vs);

            // Initialize file watcher
            FileWatcher watcher = new FileWatcher();
            watcher.Created += vs.Created;
            watcher.Changed += vs.Changed;
            watcher.Deleted += vs.Deleted;
            watcher.Renamed += vs.Renamed;
            watcher.Idle += vs.Flush;
        }
Exemple #2
0
 /// <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);
 }
Exemple #3
0
 /// <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);
 }
 /// <summary>
 /// Accept the specified visitor and peer.
 /// </summary>
 /// <param name='visitor'>
 /// The Visitor.
 /// </param>
 /// <param name='peer'>
 /// The Peer.
 /// </param>
 public abstract void Accept(AntiEntropyProtocol visitor, Peer peer);