Ignore:
Timestamp:
Sep 13, 2010, 9:31:35 PM (11 years ago)
Author:
Paul Lelgemann
Message:

o Updated peers@play libraries to revision 5611: Updated PapsClient supports OverlayMessages needed for Christian Arnolds KeySearcher
o Improved handling of SystemLeft events, allowing to reconnect with P2PEditor using Paps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypP2P/Internal/P2PBase.cs

    r1914 r1919  
    5353        #region Variables
    5454
    55         private readonly AutoResetEvent systemJoined;
     55        private AutoResetEvent systemJoined;
    5656        private readonly AutoResetEvent systemLeft;
    5757        private IBootstrapper bootstrapper;
     
    202202            IsInitialized = true;
    203203            Dht.Initialize(P2PSettings.Default.PeerName, string.Empty, P2PSettings.Default.WorldName, overlay,
    204                             bootstrapper,
    205                             linkmanager, null);
     204                           bootstrapper, linkmanager, null);
    206205        }
    207206
     
    259258            Dht.BeginStop(null);
    260259
    261             if (!IsConnected)
    262             {
    263                 return true;
    264             }
    265 
    266             // wait till systemLeft Event is invoked
    267             systemLeft.WaitOne();
     260            if (IsConnected)
     261                systemLeft.WaitOne();
     262
     263            systemJoined.Reset();
     264            systemLeft.Reset();
    268265
    269266            return true;
     
    329326            foreach (var del in OnP2PMessageReceived.GetInvocationList())
    330327            {
    331                 del.DynamicInvoke(pid, e.Message.Data.PopBytes(e.Message.Data.CurrentStackSize));
     328                var data = e.Message.Data.ToArray();
     329                if (e.Message.Data.CurrentStackSize != 0)
     330                    data = e.Message.Data.PopBytes(e.Message.Data.CurrentStackSize);
     331
     332                del.DynamicInvoke(pid, data);
    332333            }
    333334        }
     
    389390
    390391            // LogToMonitor("testcrash" + Encoding.UTF8.GetString(new byte[5000]));
    391             LogToMonitor("Begin: SynchStore. Key: " + key + ", " + data.Length + " bytes");
     392            LogToMonitor("Begin: SynchStore. Key: " + key + ", " + (data != null ? data.Length : 0) + " bytes");
    392393
    393394            var requestResult = new RequestResult {WaitHandle = autoResetEvent, Key = key, Data = data};
Note: See TracChangeset for help on using the changeset viewer.