diff options
author | subtly <subtly@users.noreply.github.com> | 2015-01-12 11:58:52 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2015-01-12 11:58:52 +0800 |
commit | 01ecadd74ed5740aca1fd1a4654a007c7a8a8b73 (patch) | |
tree | 79c657992ac3ee6b6eb393ee1bb712f3e3ab9a1f /peer.cpp | |
parent | feb4288b27195fa84098122d7af864ee5ffd9dbf (diff) | |
download | dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.tar dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.tar.gz dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.tar.bz2 dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.tar.lz dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.tar.xz dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.tar.zst dexon-solidity-01ecadd74ed5740aca1fd1a4654a007c7a8a8b73.zip |
Connectivity and nodetable callbacks. Disable stale code.
Diffstat (limited to 'peer.cpp')
-rw-r--r-- | peer.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -20,6 +20,7 @@ * Peer Network test functions. */ +#include <boost/test/unit_test.hpp> #include <chrono> #include <thread> #include <libp2p/Host.h> @@ -27,6 +28,28 @@ using namespace std; using namespace dev; using namespace dev::p2p; +BOOST_AUTO_TEST_SUITE(p2p) + +BOOST_AUTO_TEST_CASE(host) +{ + NetworkPreferences host1prefs(30301, "127.0.0.1", true, true); + NetworkPreferences host2prefs(30302, "127.0.0.1", true, true); + + Host host1("Test", host1prefs); + NodeId node1 = host1.id(); + host1.start(); + + Host host2("Test", host2prefs); + auto node2 = host2.id(); + host2.start(); + + host1.addNode(node2, "127.0.0.1", host2prefs.listenPort, host2prefs.listenPort); + + this_thread::sleep_for(chrono::seconds(2)); +} + +BOOST_AUTO_TEST_SUITE_END() + int peerTest(int argc, char** argv) { short listenPort = 30303; |