Ignore:
Timestamp:
Feb 22, 2010, 2:19:39 PM (12 years ago)
Author:
arnold
Message:

P2PManager: Design embellished and added an "estimated end time" information.
Samples: Output Boxes for KeySearcher Outputs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeerSubscriber/P2PSubscriberBase.cs

    r1144 r1166  
    171171                    GuiLogging("Found a Publisher/Manager with ID '" + pid.ToString() + ", so register with it.", NotificationLevel.Info);
    172172                    SendMessage(pid, PubSubMessageType.Register);
    173                     timeoutForPublishersRegAccept.Start();
     173                    this.timeoutForPublishersRegAccept.Start();
    174174                }
    175175                else if (actualPublisher == pid)
     
    186186                        + "' to '" + pid.ToString() + "'. Register with the new Publisher/Manager.", NotificationLevel.Info);
    187187                    SendMessage(pid, PubSubMessageType.Register);
    188                     timeoutForPublishersRegAccept.Start();
     188                    this.timeoutForPublishersRegAccept.Start();
    189189                }
    190190                this.actualPublisher = pid;
     
    315315        {
    316316            CheckPublishersAvailability2();
    317 
    318             //PeerId newPubId = CheckPublishersAvailability();
    319 
    320             //if (newPubId == actualPublisher)
    321             //{
    322             //    // Timer will be only stopped, when OnMessageReceived-Event received
    323             //    // a Pong-Response from the publisher!
    324             //    SendMessage(actualPublisher, PubSubMessageType.Ping);
    325             //    this.timeoutForPublishersPong.Start();
    326             //}
    327317        }
    328318
     
    335325            GuiLogging("TIMEOUT: Waiting for registering accepted message from publisher!", NotificationLevel.Debug);
    336326            // try to register again
    337            
    338             //Register();
    339327            CheckPublishersAvailability2();
    340328        }
     
    350338            // try to get an active publisher and re-register
    351339
    352             //CheckPublishersAvailability();
    353340            CheckPublishersAvailability2();
    354341        }
     
    401388    }
    402389}
    403 
    404 
    405 
    406 //private void Register()
    407 //        {
    408 //            // because CheckPublishersAvailability checks this value, set it for the first time here...
    409 //            // if bolStopped = true, the Timer for Checking Publishers liveliness doesn't start
    410 //            this.bolStopped = false;
    411 //            PeerId pubId = CheckPublishersAvailability();
    412 //            // if DHT Entry for the task is empty, no Publisher exists at present.
    413 //            // The method CheckPublishersAvailability starts a Timer for this case to continous proof Publisher-DHT-Entry
    414 //            if (pubId == null)
    415 //            {
    416 //                this.Started = false;
    417 //                // if PubId is null, the Publisher isn't started!
    418 //                this.bolStopped = true;
    419 //                GuiLogging("No publisher for registering found.", NotificationLevel.Info);
    420 //                return;
    421 //            }
    422 
    423 //            // when the actual publisher differs from the new detected publisher, change it
    424 //            if (pubId != null && (actualPublisher != null && actualPublisher != pubId))
    425 //            {
    426 //                GuiLogging("Publisher has been changed from ID '" + actualPublisher + "' to '" + pubId + "'", NotificationLevel.Debug);
    427 //                actualPublisher = pubId;
    428 //            }
    429 //            SendMessage(pubId, PubSubMessageType.Register);
    430 //            this.timeoutForPublishersRegAccept.Start();
    431 //            this.started = true;
    432 //        }
    433 
    434 //        /// <summary>
    435 //        /// Returns the actual Publishers ID or null, when a publisher wasn't found in the DHT. In the second case,
    436 //        /// a Timer will be started, to check periodically the DHT entry.
    437 //        /// When the publishers entry changed the Publishers ID, a Register-message will be send to the new Publisher.
    438 //        /// The Timer for periodically checking the Publishers availability is also started here.
    439 //        /// </summary>
    440 //        /// <returns>the actual Publishers ID or null, when a publisher wasn't found in the DHT</returns>
    441 //        private PeerId CheckPublishersAvailability()
    442 //        {
    443 //            PeerId pid = DHT_CommonManagement.GetTopicsPublisherId(ref this.p2pControl, this.sTopic);
    444 
    445 //            if (pid == null)
    446 //            {
    447 //                // do nothing, because every time this method will be invoked by
    448 //                // the timerCheckPubAvailability-Event, the DHT entry will be checked
    449 //                GuiLogging("Publisher wasn't found in DHT or settings didn't stored on the right way.", NotificationLevel.Debug);
    450 //                return null;
    451 //            }
    452 
    453 //            sendAliveMessageInterval = DHT_CommonManagement.GetAliveMessageInterval(ref this.p2pControl, this.sTopic);
    454 
    455 //            if (sendAliveMessageInterval == 0)
    456 //            {
    457 //                GuiLogging("Can't find AliveMsg-Settings from Publisher for the Subscriber.", NotificationLevel.Error);
    458 //                return null;
    459 //            }
    460 //            this.timerSendingAliveMsg.Interval = Convert.ToDouble(sendAliveMessageInterval);
    461 //            this.timerSendingAliveMsg.Start();
    462 
    463 //            if (actualPublisher == null) //first time initialization
    464 //            {
    465 //                actualPublisher = pid;
    466 //                GuiLogging("First time received publishers ID.", NotificationLevel.Debug);
    467 //            }
    468 
    469 //            GuiLogging("RECEIVED: Publishers' peer ID '" + pid + "', Alive-Msg-Interval: " + sendAliveMessageInterval / 1000 + " sec!", NotificationLevel.Debug);
    470 
    471 //            this.timerCheckPubAvailability.Start();
    472 //            // setting timer to check periodical the availability of the publishing peer
    473 
    474 //            return pid;
    475 //        }
Note: See TracChangeset for help on using the changeset viewer.