Ignore:
Timestamp:
Jun 3, 2010, 4:34:22 PM (12 years ago)
Author:
Paul Lelgemann
Message:

+ Introduced dirty hack to shutdown the peer-to-peer network in CrypWin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypP2P/P2PManager.cs

    r1579 r1580  
    2222using Cryptool.PluginBase.Miscellaneous;
    2323using Cryptool.Plugins.PeerToPeer.Internal;
    24 using PeersAtPlay;
    2524using PeersAtPlay.P2PStorage.DHT;
    2625using PeersAtPlay.Util.Threading;
     
    3837            P2PBase = new P2PBase();
    3938
    40             // Register events
    41 
    4239            // to forward event from overlay/dht MessageReceived-Event from P2PBase
    4340            P2PBase.OnP2PMessageReceived += OnP2PMessageReceived;
    44 
    45             // Register exit event to terminate P2P connection without loosing data
    46             // TODO check if this is correct, should be - but handler is not called (and application does not shut down), probably unrelated to this problem
    47             Application.ApplicationExit += HandleDisconnectByApplicationShutdown;
    4841        }
    4942
     
    132125
    133126        #region Framework methods
    134 
    135         private void HandleDisconnectByApplicationShutdown(object sender, EventArgs e)
    136         {
    137             if (IsP2PConnected())
    138             {
    139                 new ConnectionWorker(P2PBase).Start();
    140             }
    141         }
    142127
    143128        public void GuiLogMessage(string message, NotificationLevel logLevel)
     
    272257
    273258        #endregion DHT operations (non-blocking)
     259
     260        public void HandleShutdown()
     261        {
     262            if (IsP2PConnected())
     263            {
     264                new ConnectionWorker(P2PBase).Start();
     265            }
     266        }
    274267    }
    275268
Note: See TracChangeset for help on using the changeset viewer.