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