Challenge Message Timeouts
by SDSC ITEST · in Torque Game Engine · 08/31/2007 (7:08 pm) · 0 replies
Hey guys,
seems to be a problem in the network library in TGE 152. The wrong variable is (possibly) being initialized in netInterface.cc.
Here's the code that checks the number of send challenge messages. It checks the variable mConnectSendCount against ChallengeRetryCount (defined in netInterface.h as 4).
Here's the code that starts the challenge attempts. mConnectionSendCount is set to 0, but not mConnectSendCount.
Im pretty convinced this is a bug, I made the modification and now things seem to be working better.
seems to be a problem in the network library in TGE 152. The wrong variable is (possibly) being initialized in netInterface.cc.
Here's the code that checks the number of send challenge messages. It checks the variable mConnectSendCount against ChallengeRetryCount (defined in netInterface.h as 4).
void NetInterface::checkTimeouts()
{
...
if(pending->getConnectionState() == NetConnection::AwaitingChallengeResponse &&
time > pending->mConnectLastSendTime + ChallengeRetryTime)
{
if(pending->mConnectSendCount > ChallengeRetryCount)
{
pending->onConnectTimedOut();
removePendingConnection(pending);
pending->deleteObject();
continue;
}
else
sendConnectChallengeRequest(pending);
}
...
}Here's the code that starts the challenge attempts. mConnectionSendCount is set to 0, but not mConnectSendCount.
void NetInterface::startConnection(NetConnection *conn)
{
addPendingConnection(conn);
conn->mConnectionSendCount = 0;
conn->setConnectSequence(Platform::getVirtualMilliseconds());
conn->setConnectionState(NetConnection::AwaitingChallengeResponse);
// This is a the client side of the connection, so set the connection to
// server flag. We need to set this early so that if the connection times
// out, its onRemove() will handle the cleanup properly.
conn->setIsConnectionToServer();
// Everything set, so send off the request.
conn->mConnectSendCount = 0; // added
sendConnectChallengeRequest(conn);
}Im pretty convinced this is a bug, I made the modification and now things seem to be working better.