Data Structures | Public Member Functions | Static Public Member Functions

ConnectionCount Class Reference

Singleton class to keep track of the number of connections per host. More...

#include <HttpConnectionCount.h>

Collaboration diagram for ConnectionCount:
Collaboration graph
[legend]

Data Structures

struct  ConnAddr
class  ConnAddrHashFns

Public Member Functions

int getCount (const IpEndpoint &addr)
 Gets the number of connections for the host.
void incrementCount (const IpEndpoint &addr, const int delta=1)
 Change (increment/decrement) the connection count.

Static Public Member Functions

static ConnectionCountgetInstance ()
 Static method to get the instance of the class.

Detailed Description

Singleton class to keep track of the number of connections per host.

Definition at line 33 of file HttpConnectionCount.h.


Member Function Documentation

int ConnectionCount::getCount ( const IpEndpoint addr  )  [inline]

Gets the number of connections for the host.

Parameters:
ip IP address of the host
Returns:
Number of connections

Definition at line 49 of file HttpConnectionCount.h.

References HashMap< K, AHashFns, C, A >::get(), ink_mutex_acquire(), and ink_mutex_release().

Referenced by HttpSM::do_http_server_open(), HttpServerSession::do_io_close(), ServerSessionPool::eventHandler(), and HttpServerSession::new_connection().

static ConnectionCount* ConnectionCount::getInstance (  )  [inline, static]

Static method to get the instance of the class.

Returns:
Returns a pointer to the instance of the class

Definition at line 40 of file HttpConnectionCount.h.

Referenced by HttpSM::do_http_server_open(), and HttpServerSession::new_connection().

void ConnectionCount::incrementCount ( const IpEndpoint addr,
const int  delta = 1 
) [inline]

Change (increment/decrement) the connection count.

Parameters:
ip IP address of the host
delta Default is +1, can be set to negative to decrement

Definition at line 61 of file HttpConnectionCount.h.

References HashMap< K, AHashFns, C, A >::get(), ink_mutex_acquire(), ink_mutex_release(), and HashMap< K, AHashFns, C, A >::put().

Referenced by HttpServerSession::do_io_close(), and HttpServerSession::new_connection().


The documentation for this class was generated from the following files: