add a b3Clock::usleep in PhysicsClientUDP to avoid clogging all resources

report more meaningful connection status for UDP.
This commit is contained in:
erwincoumans
2017-01-28 12:42:04 -08:00
parent 5c92bee01c
commit 2b3c25d5f2
2 changed files with 20 additions and 7 deletions

View File

@@ -10,11 +10,19 @@ b3PhysicsClientHandle b3ConnectPhysicsUDP(const char* hostName, int port)
UdpNetworkedPhysicsProcessor* udp = new UdpNetworkedPhysicsProcessor(hostName, port);
PhysicsDirect* direct = new PhysicsDirect(udp,true);
PhysicsDirect* direct = new PhysicsDirect(udp, true);
bool connected;
connected = direct->connect();
printf("direct!\n");
if (connected)
{
printf("b3ConnectPhysicsUDP connected successfully.\n");
}
else
{
printf("b3ConnectPhysicsUDP NOT connected.\n");
}
return (b3PhysicsClientHandle)direct;
}