MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / connectionIsOpen

Method connectionIsOpen

source/game/StarUniverseConnection.cpp:193–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193bool UniverseConnectionServer::connectionIsOpen(ConnectionId clientId) const {
194 RecursiveMutexLocker connectionsLocker(m_connectionsMutex);
195 if (auto conn = m_connections.value(clientId)) {
196 connectionsLocker.unlock();
197 MutexLocker connectionLocker(conn->mutex);
198 return conn->packetSocket->isOpen();
199 }
200
201 throw UniverseConnectionException::format("No such client '{}' in UniverseConnectionServer::connectionIsOpen", clientId);
202}
203
204int64_t UniverseConnectionServer::lastActivityTime(ConnectionId clientId) const {
205 RecursiveMutexLocker connectionsLocker(m_connectionsMutex);

Callers 2

reapConnectionsMethod · 0.80
doDisconnectionMethod · 0.80

Calls 4

formatFunction · 0.50
valueMethod · 0.45
unlockMethod · 0.45
isOpenMethod · 0.45

Tested by

no test coverage detected