MediaWiki  REL1_22
LockServerDaemon Class Reference

Simple lock server daemon that accepts lock/unlock requests. More...

Collaboration diagram for LockServerDaemon:

List of all members.

Public Member Functions

 main ()
 Entry-point function that listens to the server socket, accepts new clients, and recieves/responds to requests to lock resources.

Static Public Member Functions

static init (array $config)
 $config Array

Protected Member Functions

 __construct (array $config)
 $config Array
 doCommand ($data, $sourceSock)
 getCommand ($data)
 purgeExpiredLocks ()
 Clear locks for sessions that have been dead for a while.
 recordDeadSocket ($socket)
 Remove a socket's corresponding session from tracking and store it in the dead session tracking if it still has locks.
 setupServerSocket ()
 stat ()
 Get the current timestamp and memory usage.

Protected Attributes

 $address
 $authKey
Array $deadSessions = array()
 *
LockHolder $lockHolder
 *
 $lockTimeout
 $maxBacklog
 $maxClients
 $port
Array $sessions = array()
 *
resource $sock
 *
 $startTime
 $ticks = 0

Static Protected Attributes

static $instance = null

Detailed Description

Simple lock server daemon that accepts lock/unlock requests.

Definition at line 45 of file LockServerDaemon.php.


Constructor & Destructor Documentation

LockServerDaemon::__construct ( array config) [protected]

$config Array

Definition at line 91 of file LockServerDaemon.php.

References port().


Member Function Documentation

LockServerDaemon::doCommand ( data,
sourceSock 
) [protected]
Parameters:
$datastring
$sourceSockresource
Returns:
string

Definition at line 210 of file LockServerDaemon.php.

LockServerDaemon::getCommand ( data) [protected]
Parameters:
$datastring
Returns:
Array

Definition at line 237 of file LockServerDaemon.php.

static LockServerDaemon::init ( array config) [static]

$config Array

Parameters:
array$config
Exceptions:
Exception
Returns:
LockServerDaemon

Definition at line 71 of file LockServerDaemon.php.

Entry-point function that listens to the server socket, accepts new clients, and recieves/responds to requests to lock resources.

Definition at line 142 of file LockServerDaemon.php.

Clear locks for sessions that have been dead for a while.

Returns:
integer Number of sessions purged

Definition at line 300 of file LockServerDaemon.php.

LockServerDaemon::recordDeadSocket ( socket) [protected]

Remove a socket's corresponding session from tracking and store it in the dead session tracking if it still has locks.

Parameters:
$socketresource
Returns:
bool

Definition at line 282 of file LockServerDaemon.php.

Exceptions:
Exception
Returns:
void

Definition at line 117 of file LockServerDaemon.php.

LockServerDaemon::stat ( ) [protected]

Get the current timestamp and memory usage.

Returns:
string

Definition at line 318 of file LockServerDaemon.php.


Member Data Documentation

LockServerDaemon::$address [protected]

Definition at line 52 of file LockServerDaemon.php.

LockServerDaemon::$authKey [protected]

Definition at line 54 of file LockServerDaemon.php.

Array LockServerDaemon::$deadSessions = array() [protected]

*

Definition at line 48 of file LockServerDaemon.php.

LockServerDaemon::$instance = null [static, protected]

Definition at line 63 of file LockServerDaemon.php.

LockHolder LockServerDaemon::$lockHolder [protected]

*

Definition at line 50 of file LockServerDaemon.php.

LockServerDaemon::$lockTimeout [protected]

Definition at line 55 of file LockServerDaemon.php.

LockServerDaemon::$maxBacklog [protected]

Definition at line 56 of file LockServerDaemon.php.

LockServerDaemon::$maxClients [protected]

Definition at line 57 of file LockServerDaemon.php.

LockServerDaemon::$port [protected]

Definition at line 53 of file LockServerDaemon.php.

Array LockServerDaemon::$sessions = array() [protected]

*

Definition at line 47 of file LockServerDaemon.php.

resource LockServerDaemon::$sock [protected]

*

Definition at line 46 of file LockServerDaemon.php.

LockServerDaemon::$startTime [protected]

Definition at line 59 of file LockServerDaemon.php.

LockServerDaemon::$ticks = 0 [protected]

Definition at line 60 of file LockServerDaemon.php.


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