summaryrefslogtreecommitdiff
path: root/testnet/SimNet.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-23 16:46:09 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-23 16:46:09 -0700
commit4fbb098daa349a663015426d1210f1b59d0478c4 (patch)
treeb2f5ca2c32c24bab5ad428d2c2323a1a75bb9b52 /testnet/SimNet.hpp
parent0a195e7bc0e23a5a7978a75befe8843d6e69aecd (diff)
downloadinfinitytier-4fbb098daa349a663015426d1210f1b59d0478c4.tar.gz
infinitytier-4fbb098daa349a663015426d1210f1b59d0478c4.zip
Testnet work... getting there!
Diffstat (limited to 'testnet/SimNet.hpp')
-rw-r--r--testnet/SimNet.hpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/testnet/SimNet.hpp b/testnet/SimNet.hpp
index 6f7c5c11..4fdd6939 100644
--- a/testnet/SimNet.hpp
+++ b/testnet/SimNet.hpp
@@ -34,13 +34,12 @@
#include "../node/Constants.hpp"
#include "../node/InetAddress.hpp"
#include "../node/Mutex.hpp"
-#include "../node/CMWC4096.hpp"
#include "SimNetSocketManager.hpp"
#define ZT_SIMNET_MAX_TESTNET_SIZE 1048576
-namespcae ZeroTier {
+namespace ZeroTier {
/**
* A simulated headless IP network for testing
@@ -52,9 +51,9 @@ public:
~SimNet();
/**
- * @return New endpoint with random IP address
+ * @return New endpoint or NULL on failure
*/
- SimNetSocketManager *newEndpoint();
+ SimNetSocketManager *newEndpoint(const InetAddress &addr);
/**
* @param addr Address to look up
@@ -62,14 +61,8 @@ public:
*/
SimNetSocketManager *get(const InetAddress &addr);
- /**
- * @return All socket managers (pointers remain safe while SimNet is running-- these aren't cleaned)
- */
- std::vector<SimNetSocketManager *> all();
-
private:
- std::map< InetAddress,SimNetSocketManager > _endpoints;
- CMWC4096 _prng;
+ std::map< InetAddress,SimNetSocketManager * > _endpoints;
Mutex _lock;
};