diff options
author | subtly <subtly@users.noreply.github.com> | 2015-01-26 11:54:15 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2015-01-26 11:54:15 +0800 |
commit | 57e1acfbd698dda688a86ed137a8fb5022bfc460 (patch) | |
tree | c20821dd22b4b25ad879c13cccf4b8a952c4ad76 | |
parent | 2ed2a8ec8e2a1abe8bdc6bfc8cb0f81d1c6374c2 (diff) | |
download | dexon-solidity-57e1acfbd698dda688a86ed137a8fb5022bfc460.tar.gz dexon-solidity-57e1acfbd698dda688a86ed137a8fb5022bfc460.tar.zst dexon-solidity-57e1acfbd698dda688a86ed137a8fb5022bfc460.zip |
fix ping-timeouts
-rw-r--r-- | peer.cpp | 2 | ||||
-rw-r--r-- | whisperTopic.cpp | 22 |
2 files changed, 14 insertions, 10 deletions
@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(host) host1.addNode(node2, "127.0.0.1", host2prefs.listenPort, host2prefs.listenPort); - this_thread::sleep_for(chrono::seconds(1)); + this_thread::sleep_for(chrono::seconds(3)); } BOOST_AUTO_TEST_SUITE_END() diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 02fccbc9..eccdf16c 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -34,12 +34,21 @@ BOOST_AUTO_TEST_CASE(topic) { cnote << "Testing Whisper..."; auto oldLogVerbosity = g_logVerbosity; - g_logVerbosity = 5; + g_logVerbosity = 0; - Host phOther("Test", NetworkPreferences(30303, "127.0.0.1", true, true)); + Host phOther("Test", NetworkPreferences(30303, "127.0.0.1", false, true)); auto whOther = phOther.registerCapability(new WhisperHost()); phOther.start(); + Host ph("Test", NetworkPreferences(30300, "127.0.0.1", false, true)); + auto wh = ph.registerCapability(new WhisperHost()); + ph.start(); + + this_thread::sleep_for(chrono::milliseconds(100)); + ph.addNode(phOther.id(), "127.0.0.1", 30303, 30303); + + this_thread::sleep_for(chrono::milliseconds(500)); + bool started = false; unsigned result = 0; std::thread listener([&]() @@ -61,16 +70,11 @@ BOOST_AUTO_TEST_CASE(topic) } this_thread::sleep_for(chrono::milliseconds(50)); } + }); - Host ph("Test", NetworkPreferences(30300, "127.0.0.1", true, true)); - auto wh = ph.registerCapability(new WhisperHost()); - ph.start(); - ph.addNode(phOther.id(), "127.0.0.1", 30303, 30303); - - this_thread::sleep_for(chrono::milliseconds(300)); while (!started) - this_thread::sleep_for(chrono::milliseconds(25)); + this_thread::sleep_for(chrono::milliseconds(1)); KeyPair us = KeyPair::create(); |