MediaWiki  REL1_19
LockServerDaemon Class Reference

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

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
 $deadSessions = array()
 $lockHolder
 $lockTimeout
 $maxBacklog
 $maxClients
 $port
 $sessions = array()
 $sock
 $startTime
 $ticks = 0

Static Protected Attributes

static $instance = null

Detailed Description

Simple lock server daemon that accepts lock/unlock requests.

Definition at line 27 of file LockServerDaemon.php.


Constructor & Destructor Documentation

LockServerDaemon::__construct ( array $  config) [protected]

$config Array

Definition at line 75 of file LockServerDaemon.php.


Member Function Documentation

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

Definition at line 193 of file LockServerDaemon.php.

References getCommand(), and stat().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 220 of file LockServerDaemon.php.

References $command.

Referenced by doCommand().

Here is the caller graph for this function:

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

$config Array

Returns:
LockServerDaemon

Definition at line 55 of file LockServerDaemon.php.

References $instance.

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

Definition at line 125 of file LockServerDaemon.php.

References doCommand(), purgeExpiredLocks(), recordDeadSocket(), and setupServerSocket().

Here is the call graph for this function:

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

Returns:
integer Number of sessions purged

Definition at line 281 of file LockServerDaemon.php.

References $count.

Referenced by main().

Here is the caller graph for this function:

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:
book

Definition at line 263 of file LockServerDaemon.php.

Referenced by main().

Here is the caller graph for this function:

Returns:
void

Definition at line 100 of file LockServerDaemon.php.

References $sock.

Referenced by main().

Here is the caller graph for this function:

LockServerDaemon::stat ( ) [protected]

Get the current timestamp and memory usage.

Returns:
string

Definition at line 299 of file LockServerDaemon.php.

Referenced by doCommand().

Here is the caller graph for this function:


Member Data Documentation

LockServerDaemon::$address [protected]

Definition at line 38 of file LockServerDaemon.php.

LockServerDaemon::$authKey [protected]

Definition at line 40 of file LockServerDaemon.php.

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

Definition at line 33 of file LockServerDaemon.php.

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

Definition at line 49 of file LockServerDaemon.php.

Referenced by init().

LockServerDaemon::$lockHolder [protected]

Definition at line 36 of file LockServerDaemon.php.

LockServerDaemon::$lockTimeout [protected]

Definition at line 41 of file LockServerDaemon.php.

LockServerDaemon::$maxBacklog [protected]

Definition at line 42 of file LockServerDaemon.php.

LockServerDaemon::$maxClients [protected]

Definition at line 43 of file LockServerDaemon.php.

LockServerDaemon::$port [protected]

Definition at line 39 of file LockServerDaemon.php.

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

Definition at line 31 of file LockServerDaemon.php.

LockServerDaemon::$sock [protected]

Definition at line 29 of file LockServerDaemon.php.

Referenced by setupServerSocket().

LockServerDaemon::$startTime [protected]

Definition at line 45 of file LockServerDaemon.php.

LockServerDaemon::$ticks = 0 [protected]

Definition at line 46 of file LockServerDaemon.php.


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