- reduced peer-ping time-out from 30 to 10 seconds

- no re-try for the peer ping any more (it's a test, let's see what happens)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6921 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 51332b787d
commit 989819a28c

@ -140,22 +140,21 @@ public final class yacyClient {
Map<String, String> result = null; Map<String, String> result = null;
final String salt = crypt.randomSalt(); final String salt = crypt.randomSalt();
final List<Part> post = yacyNetwork.basicRequestPost(Switchboard.getSwitchboard(), null, salt); final List<Part> post = yacyNetwork.basicRequestPost(Switchboard.getSwitchboard(), null, salt);
for (int retry = 0; retry < 4; retry++) try { try {
// generate request // generate request
post.add(new DefaultCharsetStringPart("count", "20")); post.add(new DefaultCharsetStringPart("count", "20"));
post.add(new DefaultCharsetStringPart("seed", mySeed.genSeedStr(salt))); post.add(new DefaultCharsetStringPart("seed", mySeed.genSeedStr(salt)));
// send request // send request
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
final byte[] content = HttpConnector.wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post, 30000, false); final byte[] content = HttpConnector.wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post, 10000, false);
yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' contacted peer at " + address + ", received " + ((content == null) ? "null" : content.length) + " bytes, time = " + (System.currentTimeMillis() - start) + " milliseconds"); yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' contacted peer at " + address + ", received " + ((content == null) ? "null" : content.length) + " bytes, time = " + (System.currentTimeMillis() - start) + " milliseconds");
result = FileUtils.table(content); result = FileUtils.table(content);
break;
} catch (final Exception e) { } catch (final Exception e) {
if (Thread.currentThread().isInterrupted()) { if (Thread.currentThread().isInterrupted()) {
yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' interrupted."); yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' interrupted.");
return -1; return -1;
} }
yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "', peer " + address + "; exception: " + e.getMessage() + "; retry = " + retry); yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "', peer " + address + "; exception: " + e.getMessage());
// try again (go into loop) // try again (go into loop)
result = null; result = null;
} }

Loading…
Cancel
Save