From ef51e1bdffe66eca2f4b4a12c43842e85143e3e8 Mon Sep 17 00:00:00 2001 From: PioDer Date: Tue, 17 Jan 2017 05:13:12 +0100 Subject: [PATCH] thread dla peer1 i peer2 + poprawki --- Simulation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); }