Example #1
0
void TransportLayerLegacy::_destroy(LegacySession& session) {
    if (!session.conn()->closed) {
        _closeConnection(session.conn());
    }

    _currentConnections.subtractAndFetch(1);
}
Example #2
0
void TransportLayerLegacy::_destroy(LegacySession& session) {
    if (!session.conn()->closed) {
        _closeConnection(session.conn());
    }

    stdx::lock_guard<stdx::mutex> lk(_sessionsMutex);
    _sessions.erase(session.getIter());
}
Example #3
0
void TransportLayerLegacy::endAllSessions(Session::TagMask tags) {
    log() << "legacy transport layer closing all connections";
    {
        stdx::lock_guard<stdx::mutex> lk(_sessionsMutex);
        for (auto&& it : _sessions) {

            // Attempt to make our weak_ptr into a shared_ptr
            auto session = it.lock();
            if (session) {
                if (session->getTags() & tags) {
                    log() << "Skip closing connection for connection # "
                          << session->conn()->connectionId;
                } else {
                    _closeConnection(session->conn());
                }
            }
        }
    }
}
Example #4
0
void TransportLayerLegacy::end(const SessionHandle& session) {
    auto legacySession = checked_pointer_cast<const LegacySession>(session);
    _closeConnection(legacySession->conn());
}