mirror of
https://github.com/ChronosX88/KademliaDHT.git
synced 2024-11-22 02:02:21 +00:00
We need to synchronize some toString methods since they access some data structures that cannot be modified concurrently
This commit is contained in:
parent
d920f2621e
commit
8d3ceb3ae1
@ -14,7 +14,7 @@ public class DefaultConfiguration implements KadConfiguration
|
|||||||
private final static long RESPONSE_TIMEOUT = 1500;
|
private final static long RESPONSE_TIMEOUT = 1500;
|
||||||
private final static long OPERATION_TIMEOUT = 3000;
|
private final static long OPERATION_TIMEOUT = 3000;
|
||||||
private final static int CONCURRENCY = 10;
|
private final static int CONCURRENCY = 10;
|
||||||
private final static int K = 4;
|
private final static int K = 10;
|
||||||
private final static int RCSIZE = 3;
|
private final static int RCSIZE = 3;
|
||||||
private final static int STALE = 1;
|
private final static int STALE = 1;
|
||||||
private final static String LOCAL_FOLDER = "kademlia";
|
private final static String LOCAL_FOLDER = "kademlia";
|
||||||
|
@ -319,7 +319,7 @@ public class DHT
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public synchronized String toString()
|
||||||
{
|
{
|
||||||
return this.entriesManager.toString();
|
return this.entriesManager.toString();
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ class StoredContentManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public synchronized String toString()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder("Stored Content: \n");
|
StringBuilder sb = new StringBuilder("Stored Content: \n");
|
||||||
for (List<StorageEntryMetadata> es : this.entries.values())
|
for (List<StorageEntryMetadata> es : this.entries.values())
|
||||||
|
Loading…
Reference in New Issue
Block a user