mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-19 05:20:06 +00:00
more tcp fixes
This commit is contained in:
parent
4cbc8c2a8d
commit
6cedf26f24
@ -158,8 +158,7 @@ void TCPThreadFunc(void* userPtr, void* lsMemory)
|
||||
|
||||
socket.Listen("localhost", args->m_port);
|
||||
|
||||
socket.SetReceiveTimeout(100, 100);// (1, 0);
|
||||
socket.SetSendTimeout(100, 100);
|
||||
|
||||
|
||||
int curNumErr = 0;
|
||||
|
||||
@ -179,6 +178,9 @@ void TCPThreadFunc(void* userPtr, void* lsMemory)
|
||||
|
||||
if ((pClient = socket.Accept()) != NULL)
|
||||
{
|
||||
socket.SetReceiveTimeout(60, 0);// (1, 0);
|
||||
socket.SetSendTimeout(60, 0);
|
||||
|
||||
b3AlignedObjectArray<char> bytesReceived;
|
||||
|
||||
int clientPort = socket.GetClientPort();
|
||||
@ -264,33 +266,18 @@ void TCPThreadFunc(void* userPtr, void* lsMemory)
|
||||
|
||||
receivedData = true;
|
||||
|
||||
GraphicsSharedMemoryCommand cmd;
|
||||
|
||||
|
||||
GraphicsSharedMemoryCommand* cmdPtr = 0;
|
||||
|
||||
int type = *(int*)&bytesReceived[0];
|
||||
|
||||
//performance test
|
||||
if (numBytesRec == sizeof(int))
|
||||
|
||||
if (numBytesRec == sizeof(GraphicsSharedMemoryCommand))
|
||||
{
|
||||
cmdPtr = &cmd;
|
||||
cmd.m_type = *(int*)&bytesReceived[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numBytesRec == sizeof(GraphicsSharedMemoryCommand))
|
||||
{
|
||||
cmdPtr = (GraphicsSharedMemoryCommand*)&bytesReceived[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numBytesRec == 36)
|
||||
{
|
||||
cmdPtr = &cmd;
|
||||
memcpy(&cmd, &bytesReceived[0], numBytesRec);
|
||||
}
|
||||
}
|
||||
cmdPtr = (GraphicsSharedMemoryCommand*)&bytesReceived[0];
|
||||
}
|
||||
|
||||
if (cmdPtr)
|
||||
{
|
||||
GraphicsSharedMemoryStatus serverStatus;
|
||||
|
@ -197,8 +197,6 @@ struct RemoteGUIHelperTCPInternalData
|
||||
return true;
|
||||
|
||||
m_tcpSocket.Initialize();
|
||||
m_tcpSocket.SetReceiveTimeout(100, 100);// (1, 0);
|
||||
m_tcpSocket.SetSendTimeout(100, 100);
|
||||
|
||||
m_isConnected = m_tcpSocket.Open(m_hostName.c_str(), m_port);
|
||||
if (m_isConnected)
|
||||
|
Loading…
Reference in New Issue
Block a user