Changeset 1505


Ignore:
Timestamp:
May 26, 2010, 5:19:03 PM (12 years ago)
Author:
Paul Lelgemann
Message:

+ Added NotConnectedException in CrypP2P

Location:
trunk/CrypP2P
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypP2P/CrypP2P.csproj

    r1498 r1505  
    189189  </ItemGroup>
    190190  <ItemGroup>
     191    <Compile Include="Internal\NotConnectedException.cs" />
    191192    <Compile Include="P2PSettings.cs" />
    192193    <Compile Include="Worker\ConnectionWorker.cs" />
  • trunk/CrypP2P/P2PManager.cs

    r1504 r1505  
    115115        #region DHT operations
    116116
    117         // TODO add error handling, if P2P is not connected
    118117        public static bool Store(string key, byte[] data)
    119118        {
     119            if (!Instance.P2PConnected())
     120                throw new NotConnectedException();
     121
    120122            return Instance.P2PBase.SynchStore(key, data);
    121123        }
     
    123125        public static bool Store(string key, string data)
    124126        {
     127            if (!Instance.P2PConnected())
     128                throw new NotConnectedException();
     129           
    125130            return Instance.P2PBase.SynchStore(key, data);
    126131        }
     
    128133        public static byte[] Retrieve(string key)
    129134        {
     135            if (!Instance.P2PConnected())
     136                throw new NotConnectedException();
     137           
    130138            return Instance.P2PBase.SynchRetrieve(key);
    131139        }
     
    133141        public static bool Remove(string key)
    134142        {
     143            if (!Instance.P2PConnected())
     144                throw new NotConnectedException();
     145
    135146            return Instance.P2PBase.SynchRemove(key);
    136147        }
Note: See TracChangeset for help on using the changeset viewer.