MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / handleConnectAccept

Method handleConnectAccept

Engine/source/sim/netInterface.cpp:351–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void NetInterface::handleConnectAccept(const NetAddress *address, BitStream *stream)
352{
353 U32 connectSequence;
354 stream->read(&connectSequence);
355 NetConnection *conn = findPendingConnection(address, connectSequence);
356 if(!conn || conn->getConnectionState() != NetConnection::AwaitingConnectResponse)
357 return;
358 const char *errorString = NULL;
359 if(!conn->readConnectAccept(stream, &errorString))
360 {
361 conn->handleStartupError(errorString);
362 removePendingConnection(conn);
363 conn->deleteObject();
364 return;
365 }
366
367 removePendingConnection(conn); // remove from the pending connection list
368 conn->setNetworkConnection(true);
369 conn->onConnectionEstablished(true); // notify the connection that it has been established
370 conn->setEstablished(); // installs the connection in the connection table, and causes pings/timeouts to happen
371 conn->setConnectSequence(connectSequence);
372}
373
374void NetInterface::sendConnectReject(NetConnection *conn, const char *reason)
375{

Callers

nothing calls this directly

Calls 9

setNetworkConnectionMethod · 0.80
setEstablishedMethod · 0.80
setConnectSequenceMethod · 0.80
readMethod · 0.45
getConnectionStateMethod · 0.45
readConnectAcceptMethod · 0.45
handleStartupErrorMethod · 0.45
deleteObjectMethod · 0.45

Tested by

no test coverage detected