Handle XRootD stream IDs.
More...
#include <XrdClSIDManager.hh>
Handle XRootD stream IDs.
Definition at line 42 of file XrdClSIDManager.hh.
◆ ~SIDManager()
| XrdCl::SIDManager::~SIDManager |
( |
| ) |
|
|
inline |
◆ AllocateSID()
| Status XrdCl::SIDManager::AllocateSID |
( |
uint8_t |
sid[2] | ) |
|
Allocate a SID
- Parameters
-
| sid | a two byte array where the allocated SID should be stored |
- Returns
- stOK on success, stError on error
Definition at line 36 of file XrdClSIDManager.cc.
40 uint16_t allocSID = 1;
45 if( !pFreeSIDs.empty() )
47 allocSID = pFreeSIDs.front();
48 pFreeSIDs.pop_front();
55 if( pSIDCeiling == 0xffff )
57 allocSID = pSIDCeiling++;
60 memcpy( sid, &allocSID, 2 );
61 pAllocTime[allocSID] = time(0);
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errNoMoreFreeSIDs
References XrdCl::errNoMoreFreeSIDs, and XrdCl::stError.
◆ GetNumberOfAllocatedSIDs()
| uint16_t XrdCl::SIDManager::GetNumberOfAllocatedSIDs |
( |
| ) |
const |
Number of allocated streams.
Definition at line 143 of file XrdClSIDManager.cc.
146 return pSIDCeiling - pFreeSIDs.size() - pTimeOutSIDs.size() - 1;
◆ IsAnySIDOldAs()
| bool XrdCl::SIDManager::IsAnySIDOldAs |
( |
const time_t |
tlim | ) |
const |
Check if any SID was allocated at or before a given time.
Definition at line 92 of file XrdClSIDManager.cc.
95 return std::any_of( pAllocTime.begin(), pAllocTime.end(),
98 return p.second <= tlim;
◆ IsTimedOut()
| bool XrdCl::SIDManager::IsTimedOut |
( |
uint8_t |
sid[2] | ) |
|
Check if a SID is timed out.
Definition at line 105 of file XrdClSIDManager.cc.
109 memcpy( &tiSID, sid, 2 );
110 std::set<uint16_t>::iterator it = pTimeOutSIDs.find( tiSID );
111 if( it != pTimeOutSIDs.end() )
◆ NumberOfTimedOutSIDs()
| uint32_t XrdCl::SIDManager::NumberOfTimedOutSIDs |
( |
| ) |
const |
|
inline |
Number of timeout sids.
Definition at line 109 of file XrdClSIDManager.hh.
112 return pTimeOutSIDs.size();
◆ ReleaseAllTimedOut()
| void XrdCl::SIDManager::ReleaseAllTimedOut |
( |
| ) |
|
Release all timed out SIDs.
Definition at line 131 of file XrdClSIDManager.cc.
134 std::set<uint16_t>::iterator it;
135 for( it = pTimeOutSIDs.begin(); it != pTimeOutSIDs.end(); ++it )
136 pFreeSIDs.push_back( *it );
137 pTimeOutSIDs.clear();
◆ ReleaseSID()
| void XrdCl::SIDManager::ReleaseSID |
( |
uint8_t |
sid[2] | ) |
|
Release the SID that is no longer needed.
Definition at line 68 of file XrdClSIDManager.cc.
72 memcpy( &relSID, sid, 2 );
73 pFreeSIDs.push_back( relSID );
74 pAllocTime.erase( relSID );
◆ ReleaseTimedOut()
| void XrdCl::SIDManager::ReleaseTimedOut |
( |
uint8_t |
sid[2] | ) |
|
Release a timed out SID.
Definition at line 119 of file XrdClSIDManager.cc.
123 memcpy( &tiSID, sid, 2 );
124 pTimeOutSIDs.erase( tiSID );
125 pFreeSIDs.push_back( tiSID );
◆ TimeOutSID()
| void XrdCl::SIDManager::TimeOutSID |
( |
uint8_t |
sid[2] | ) |
|
Register a SID of a request that timed out.
Definition at line 80 of file XrdClSIDManager.cc.
84 memcpy( &tiSID, sid, 2 );
85 pTimeOutSIDs.insert( tiSID );
86 pAllocTime.erase( tiSID );
◆ SIDMgrPool
The documentation for this class was generated from the following files: