本文整理汇总了C++中Ticket::sessionId方法的典型用法代码示例。如果您正苦于以下问题:C++ Ticket::sessionId方法的具体用法?C++ Ticket::sessionId怎么用?C++ Ticket::sessionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::sessionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _runTicket
Status TransportLayerLegacy::_runTicket(Ticket ticket) {
if (!_running.load()) {
return TransportLayer::ShutdownStatus;
}
if (ticket.expiration() < Date_t::now()) {
return Ticket::ExpiredStatus;
}
AbstractMessagingPort* amp;
{
stdx::lock_guard<stdx::mutex> lk(_connectionsMutex);
auto conn = _connections.find(ticket.sessionId());
if (conn == _connections.end()) {
return TransportLayer::TicketSessionUnknownStatus;
}
// "check out" the port
conn->second.inUse = true;
amp = conn->second.amp.get();
}
auto legacyTicket = checked_cast<LegacyTicket*>(getTicketImpl(ticket));
auto res = legacyTicket->_fill(amp);
{
stdx::lock_guard<stdx::mutex> lk(_connectionsMutex);
auto conn = _connections.find(ticket.sessionId());
invariant(conn != _connections.end());
#ifdef MONGO_CONFIG_SSL
// If we didn't have an X509 subject name, see if we have one now
if (!conn->second.sslPeerInfo) {
auto info = amp->getX509PeerInfo();
if (info.subjectName != "") {
conn->second.sslPeerInfo = info;
}
}
#endif
conn->second.inUse = false;
if (conn->second.ended) {
Listener::globalTicketHolder.release();
_connections.erase(conn);
}
}
return res;
}