shmem preliminary TCP implementation (not working yet)

This commit is contained in:
Erwin Coumans
2017-02-20 16:46:25 -08:00
parent bfcdb8c408
commit 3d73a9d788
7 changed files with 677 additions and 0 deletions

View File

@@ -80,6 +80,68 @@ project ("Test_PhysicsClientUDP")
"../../examples/MultiThreading/b3ThreadSupportInterface.cpp",
}
project ("Test_PhysicsClientTCP")
language "C++"
kind "ConsoleApp"
includedirs {
"../../src",
"../../examples",
"../../examples/ThirdPartyLibs/clsocket/src"
}
links {
"clsocket",
"BulletFileLoader",
"Bullet3Common",
"LinearMath"
}
if os.is("Windows") then
defines { "WIN32" }
links {"Ws2_32","Winmm"}
end
if os.is("Windows") then
defines { "WIN32","_WINSOCK_DEPRECATED_NO_WARNINGS" }
end
if os.is("Linux") then
defines {"_LINUX"}
end
if os.is("MacOSX") then
defines {"_DARWIN"}
end
defines {"PHYSICS_TCP"}
files {
"test.c",
"../../examples/SharedMemory/PhysicsClient.cpp",
"../../examples/SharedMemory/PhysicsClient.h",
"../../examples/SharedMemory/PhysicsClientSharedMemory.cpp",
"../../examples/SharedMemory/PhysicsClientSharedMemory.h",
"../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.cpp",
"../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.h",
"../../examples/SharedMemory/PhysicsClientTCP.cpp",
"../../examples/SharedMemory/PhysicsClientTCP.h",
"../../examples/SharedMemory/PhysicsClientTCP_C_API.cpp",
"../../examples/SharedMemory/PhysicsClientTCP_C_API.h",
"../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.h",
"../../examples/SharedMemory/PhysicsClientC_API.cpp",
"../../examples/SharedMemory/PhysicsClientC_API.h",
"../../examples/SharedMemory/Win32SharedMemory.cpp",
"../../examples/SharedMemory/Win32SharedMemory.h",
"../../examples/SharedMemory/PosixSharedMemory.cpp",
"../../examples/SharedMemory/PosixSharedMemory.h",
"../../examples/Utils/b3ResourcePath.cpp",
"../../examples/Utils/b3ResourcePath.h",
"../../examples/SharedMemory/PhysicsDirect.cpp",
"../../examples/Utils/b3Clock.cpp",
"../../examples/MultiThreading/b3PosixThreadSupport.cpp",
"../../examples/MultiThreading/b3Win32ThreadSupport.cpp",
"../../examples/MultiThreading/b3ThreadSupportInterface.cpp",
}
project ("Test_PhysicsServerLoopBack")

View File

@@ -8,6 +8,10 @@
#include "SharedMemory/PhysicsClientUDP_C_API.h"
#endif//PHYSICS_UDP
#ifdef PHYSICS_TCP
#include "SharedMemory/PhysicsClientTCP_C_API.h"
#endif//PHYSICS_TCP
#ifdef PHYSICS_LOOP_BACK
#include "SharedMemory/PhysicsLoopBackC_API.h"
#endif //PHYSICS_LOOP_BACK
@@ -345,6 +349,10 @@ int main(int argc, char* argv[])
b3PhysicsClientHandle sm = b3ConnectPhysicsUDP("localhost",1234);
#endif //PHYSICS_UDP
#ifdef PHYSICS_TCP
b3PhysicsClientHandle sm = b3ConnectPhysicsTCP("localhost",6667);
#endif //PHYSICS_UDP
testSharedMemory(sm);
}
#endif