Data Structures | Public Member Functions | Static Public Member Functions | Data Fields | Protected Types

ServerSessionPool Class Reference

A pool of server sessions. More...

#include <HttpSessionManager.h>

Inherits Continuation.

Collaboration diagram for ServerSessionPool:
Collaboration graph
[legend]

Data Structures

struct  HostHashing
 Interface class for FQDN map. More...
struct  IPHashing
 Interface class for IP map. More...

Public Member Functions

 ServerSessionPool ()
 Default constructor.
int eventHandler (int event, void *data)
 Handle events from server sessions.
HttpServerSessionacquireSession (sockaddr const *addr, INK_MD5 const &host_hash, TSServerSessionSharingMatchType match_style)
 Get a session from the pool.
void releaseSession (HttpServerSession *ss)
 Release a session to to pool.
void purge ()
 Close all sessions and then clear the table.

Static Public Member Functions

static bool match (HttpServerSession *ss, sockaddr const *addr, INK_MD5 const &host_hash, TSServerSessionSharingMatchType match_style)
 Check if a session matches address and host name.

Data Fields

IPHashTable m_ip_pool
HostHashTable m_host_pool

Protected Types

typedef TSHashTable< IPHashingIPHashTable
 Sessions by IP address.
typedef TSHashTable< HostHashingHostHashTable
 Sessions by host name.

Detailed Description

A pool of server sessions.

This is a continuation so that it can get callbacks from the server sessions. This is used to track remote closes on the sessions so they can be cleaned up.

Definition at line 56 of file HttpSessionManager.h.


Member Typedef Documentation

Sessions by host name.

Definition at line 92 of file HttpSessionManager.h.

Sessions by IP address.

Definition at line 91 of file HttpSessionManager.h.


Constructor & Destructor Documentation

ServerSessionPool::ServerSessionPool (  ) 

Member Function Documentation

HttpServerSession * ServerSessionPool::acquireSession ( sockaddr const *  addr,
INK_MD5 const &  host_hash,
TSServerSessionSharingMatchType  match_style 
)

Get a session from the pool.

The session is selected based on match_style equivalently to match. If found the session is removed from the pool.

Returns:
A pointer to the session or NULL if not matching session was found.

Definition at line 78 of file HttpSessionManager.cc.

References ats_ip_port_cast(), TSHashTable< H >::find(), m_host_pool, m_ip_pool, TSHashTable< H >::remove(), TS_SERVER_SESSION_SHARING_MATCH_HOST, TS_SERVER_SESSION_SHARING_MATCH_IP, and TS_SERVER_SESSION_SHARING_MATCH_NONE.

Referenced by HttpSessionManager::acquire_session().

int ServerSessionPool::eventHandler ( int  event,
void *  data 
)
bool ServerSessionPool::match ( HttpServerSession ss,
sockaddr const *  addr,
INK_MD5 const &  host_hash,
TSServerSessionSharingMatchType  match_style 
) [static]
void ServerSessionPool::purge (  ) 

Close all sessions and then clear the table.

Definition at line 57 of file HttpSessionManager.cc.

References TSHashTable< H >::begin(), TSHashTable< H >::clear(), TSHashTable< H >::end(), m_host_pool, and m_ip_pool.

Referenced by HttpSessionManager::purge_keepalives().

void ServerSessionPool::releaseSession ( HttpServerSession ss  ) 

Field Documentation


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