#include <AcceptLimiter.h>

Collaboration diagram for Comm::AcceptLimiter:

Public Member Functions

void defer (const TcpAcceptor::Pointer &afd)
void removeDead (const TcpAcceptor::Pointer &afd)
void kick ()

Static Public Member Functions

static AcceptLimiterInstance ()

Private Attributes

std::vector< TcpAcceptor::Pointerdeferred_

Static Private Attributes

static AcceptLimiter Instance_

Detailed Description

FIFO Queue holding listener socket handlers which have been activated ready to dupe their FD and accept() a new client connection. But when doing so there were not enough FD available to handle the new connection. These handlers are awaiting some FD to become free.

defer - used only by Comm layer ConnAcceptor adding themselves when FD are limited. removeDead - used only by Comm layer ConnAcceptor to remove themselves when dying. kick - used by Comm layer when FD are closed.

Definition at line 39 of file AcceptLimiter.h.

Member Function Documentation

void Comm::AcceptLimiter::defer ( const TcpAcceptor::Pointer afd)

delay accepting a new client connection.

Definition at line 25 of file AcceptLimiter.cc.

References debugs.

Referenced by Comm::TcpAcceptor::doAccept().

Comm::AcceptLimiter & Comm::AcceptLimiter::Instance ( )

retrieve the global instance of the queue.

Definition at line 19 of file AcceptLimiter.cc.

References Instance_.

Referenced by comm_close_complete(), comm_init(), Comm::TcpAcceptor::doAccept(), and Comm::TcpAcceptor::swanSong().

void Comm::AcceptLimiter::kick ( )

try to accept and begin processing any delayed client connections.

Definition at line 48 of file AcceptLimiter.cc.

References debugs, fdNFree(), RESERVED_FD, and CbcPointer< Cbc >::valid().

Referenced by comm_close_complete().

void Comm::AcceptLimiter::removeDead ( const TcpAcceptor::Pointer afd)

remove all records of an acceptor. Only to be called by the ConnAcceptor::swanSong()

Definition at line 33 of file AcceptLimiter.cc.

References debugs, i, and NULL.

Referenced by Comm::TcpAcceptor::swanSong().

Member Data Documentation

std::vector<TcpAcceptor::Pointer> Comm::AcceptLimiter::deferred_

FIFO queue

Definition at line 59 of file AcceptLimiter.h.

Comm::AcceptLimiter Comm::AcceptLimiter::Instance_

Definition at line 56 of file AcceptLimiter.h.

Referenced by Instance().

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






Web Site Translations