thread dla peer1 i peer2 + poprawki
This commit is contained in:
@@ -119,9 +119,6 @@ void * Simulation::threadWrapper(void * context)
|
|||||||
{
|
{
|
||||||
case NODE_RECV:
|
case NODE_RECV:
|
||||||
((Node *)params->context)->onRecv();
|
((Node *)params->context)->onRecv();
|
||||||
// Node* c;
|
|
||||||
// c = static_cast<Node*>(params->context);
|
|
||||||
// c->onRecv();
|
|
||||||
break;
|
break;
|
||||||
case SIM_TIMER:
|
case SIM_TIMER:
|
||||||
((Simulation *)params->context)->timer();
|
((Simulation *)params->context)->timer();
|
||||||
@@ -224,8 +221,12 @@ void Simulation::p2pSimulation()
|
|||||||
this->createThread("r1", NODE_RECV, &r1);
|
this->createThread("r1", NODE_RECV, &r1);
|
||||||
this->createThread("r2", NODE_RECV, &r2);
|
this->createThread("r2", NODE_RECV, &r2);
|
||||||
this->createThread("s1", NODE_RECV, &server);
|
this->createThread("s1", NODE_RECV, &server);
|
||||||
|
this->createThread("p2", NODE_RECV, &peer2);
|
||||||
|
|
||||||
peer1.connectToServer("80.80.90.91", 6565);
|
peer1.connectToServer("80.80.90.91", 6565);
|
||||||
|
sleep(1);
|
||||||
|
this->createThread("p1", NODE_RECV, &peer1);
|
||||||
|
|
||||||
|
|
||||||
while(1);
|
while(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user