diff --git a/Simulation.cpp b/Simulation.cpp index 8794f32..fad1857 100644 --- a/Simulation.cpp +++ b/Simulation.cpp @@ -119,9 +119,6 @@ void * Simulation::threadWrapper(void * context) { case NODE_RECV: ((Node *)params->context)->onRecv(); - // Node* c; - // c = static_cast(params->context); - // c->onRecv(); break; case SIM_TIMER: ((Simulation *)params->context)->timer(); @@ -224,8 +221,12 @@ void Simulation::p2pSimulation() this->createThread("r1", NODE_RECV, &r1); this->createThread("r2", NODE_RECV, &r2); this->createThread("s1", NODE_RECV, &server); + this->createThread("p2", NODE_RECV, &peer2); peer1.connectToServer("80.80.90.91", 6565); + sleep(1); + this->createThread("p1", NODE_RECV, &peer1); + while(1); }