Changeset 707


Ignore:
Timestamp:
12/01/11 15:05:28 (6 months ago)
Author:
shiretu
Message:

-- more stuff on FdStats?

Location:
trunk/sources/thelib
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/thelib/include/netio/epoll/iohandlermanager.h

    r706 r707  
    4646        static map<uint32_t, IOHandler *> & GetActiveHandlers(); 
    4747        static map<uint32_t, IOHandler *> & GetDeadHandlers(); 
     48        static FdStats &GetStats(); 
    4849        static void Initialize(); 
    4950        static void Start(); 
  • trunk/sources/thelib/include/netio/fdstats.h

    r706 r707  
    6060        int64_t Total(); 
    6161 
     62        BaseFdStats &GetManagedTcp(); 
     63        BaseFdStats &GetManagedTcpAcceptors(); 
     64        BaseFdStats &GetManagedTcpConnectors(); 
     65        BaseFdStats &GetManagedUdp(); 
     66        BaseFdStats &GetManagedNonTcpUdp(); 
     67        BaseFdStats &GetRawUdp(); 
     68 
    6269        void RegisterManaged(IOHandlerType type); 
    6370        void UnRegisterManaged(IOHandlerType type); 
  • trunk/sources/thelib/include/netio/kqueue/iohandlermanager.h

    r706 r707  
    5656        static map<uint32_t, IOHandler *> & GetActiveHandlers(); 
    5757        static map<uint32_t, IOHandler *> & GetDeadHandlers(); 
     58        static FdStats &GetStats(); 
    5859        static void Initialize(); 
    5960        static void Start(); 
  • trunk/sources/thelib/include/netio/select/iohandlermanager.h

    r706 r707  
    4545        static map<uint32_t, IOHandler *> & GetDeadHandlers(); 
    4646 
     47        static FdStats &GetStats(); 
    4748        /*! 
    4849                @brief Initializes the handler manager. 
  • trunk/sources/thelib/include/protocols/protocolmanager.h

    r241 r707  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    6969        */ 
    7070        static map<uint32_t, BaseProtocol *> GetActiveProtocols(); 
     71 
     72        /*! 
     73                @brief Extracts only the protocols which are tied to the network layer 
     74        */ 
     75        static void GetNetworkedProtocols(map<uint32_t, BaseProtocol *> &result); 
    7176}; 
    7277 
  • trunk/sources/thelib/src/netio/epoll/iohandlermanager.cpp

    r706 r707  
    4343} 
    4444 
     45FdStats &IOHandlerManager::GetStats() { 
     46        return _fdStats; 
     47} 
     48 
    4549void IOHandlerManager::Initialize() { 
    4650        _fdStats.Reset(); 
  • trunk/sources/thelib/src/netio/fdstats.cpp

    r706 r707  
    117117} 
    118118 
     119BaseFdStats &FdStats::GetManagedTcp() { 
     120        return _managedTcp; 
     121} 
     122 
     123BaseFdStats &FdStats::GetManagedTcpAcceptors() { 
     124        return _managedTcpAcceptors; 
     125} 
     126 
     127BaseFdStats &FdStats::GetManagedTcpConnectors() { 
     128        return _managedTcpConnectors; 
     129} 
     130 
     131BaseFdStats &FdStats::GetManagedUdp() { 
     132        return _managedUdp; 
     133} 
     134 
     135BaseFdStats &FdStats::GetManagedNonTcpUdp() { 
     136        return _managedNonTcpUdp; 
     137} 
     138 
     139BaseFdStats &FdStats::GetRawUdp() { 
     140        return _rawUdp; 
     141} 
     142 
    119143void FdStats::RegisterManaged(IOHandlerType type) { 
    120144        AccountManaged(type, true); 
  • trunk/sources/thelib/src/netio/kqueue/iohandlermanager.cpp

    r706 r707  
    8282} 
    8383 
     84FdStats &IOHandlerManager::GetStats() { 
     85        return _fdStats; 
     86} 
     87 
    8488void IOHandlerManager::Initialize() { 
    8589        _fdStats.Reset(); 
  • trunk/sources/thelib/src/netio/select/iohandlermanager.cpp

    r706 r707  
    4747} 
    4848 
     49FdStats &IOHandlerManager::GetStats() { 
     50        return _fdStats; 
     51} 
     52 
    4953void IOHandlerManager::Initialize() { 
    5054        _fdStats.Reset(); 
  • trunk/sources/thelib/src/protocols/protocolmanager.cpp

    r577 r707  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    2121#include "protocols/protocolmanager.h" 
    2222#include "protocols/baseprotocol.h" 
     23#include "netio/netio.h" 
    2324 
    2425map<uint32_t, BaseProtocol *> ProtocolManager::_activeProtocols; 
     
    8182        return _activeProtocols; 
    8283} 
     84 
     85void ProtocolManager::GetNetworkedProtocols(map<uint32_t, BaseProtocol *> &result) { 
     86        result.clear(); 
     87        FOR_MAP(_activeProtocols, uint32_t, BaseProtocol *, i) { 
     88                BaseProtocol *pProtocol = MAP_VAL(i)->GetNearEndpoint(); 
     89                if (MAP_HAS1(result, pProtocol->GetId())) 
     90                        continue; 
     91                IOHandler *pIOHandler = pProtocol->GetIOHandler(); 
     92                if ((pIOHandler == NULL) 
     93                                || ((pIOHandler->GetType() != IOHT_TCP_CARRIER) 
     94                                && (pIOHandler->GetType() != IOHT_UDP_CARRIER))) 
     95                        continue; 
     96                result[pProtocol->GetId()] = pProtocol; 
     97        } 
     98} 
Note: See TracChangeset for help on using the changeset viewer.