phpCoreLib2
[ class tree: phpCoreLib2 ] [ index: phpCoreLib2 ] [ all elements ]

Class: DSocketServerBase

Source Location: /Sockets/Server/DSocketServerBase.php

Class Overview

DObject
   |
   --DSocketServerBase

Socket server


Author(s):

Variables

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: DObject

DObject::__construct()
Constructor
DObject::debug()
Debig
DObject::getClassMembers()
Gets member variables of the instance
DObject::getClassMemberType()
Gets class member type
DObject::getClassMethods()
Gets classes of the class
DObject::getClassName()
Gets class name
DObject::PHPSerialize()
Gets serialized string of the class
DObject::trace()
Trace
DObject::__destruct()
Descructor
DObject::__toString()
Returns String equivalent of the object.

Class Details

[line 22]
Socket server



Tags:

abstract:  


[ Top ]


Class Variables

$bufferSize =  65536

[line 29]

Buffer read size



Tags:

access:  public

Type:   int


[ Top ]

$errorMsg =  ""

[line 57]

Error message



Tags:

access:  public

Type:   string


[ Top ]

$host =  ""

[line 36]

Host IP of the server



Tags:

access:  public

Type:   string


[ Top ]

$masterSocket =  null

[line 50]

Master socket



Tags:

access:  public

Type:   resource


[ Top ]

$port =  ""

[line 43]

Port of the server



Tags:

access:  public

Type:   int


[ Top ]

$_allSockets = array()

[line 72]

All sockets



Tags:

access:  protected

Type:   array


[ Top ]

$_errorSplitBuffer = array()

[line 64]

Error split buffer



Tags:

access:  protected

Type:   array


[ Top ]

$_haltCondition =  true

[line 82]

Halt condition

If set to false the server is stopped.




Tags:

access:  protected

Type:   boolean


[ Top ]



Class Methods


constructor __construct [line 92]

DSocketServerBase __construct( string $host, int $port)

Constructor



Tags:

access:  public


Overrides DObject::__construct() (Constructor)

Parameters:

string   $host  
int   $port  

[ Top ]

method initServer [line 104]

void initServer( )

Inits server



Tags:

access:  public


[ Top ]

method start [line 170]

void start( )

Starts socket server



Tags:

access:  public


[ Top ]

method _addNewSocket [line 146]

void _addNewSocket( &$socket, resource $socket)

Adds new socket



Tags:

access:  protected


Parameters:

resource   $socket  
   &$socket  

[ Top ]

method _closeSocket [line 157]

void _closeSocket( &$socket, resource $socket)

Closes socket



Tags:

access:  protected


Parameters:

resource   $socket  
   &$socket  

[ Top ]

method _getSocketId [line 210]

int _getSocketId( &$socket, resource $socket)

Gets socket id from socket resource



Tags:

access:  public


Parameters:

resource   $socket  
   &$socket  

[ Top ]

method _handleCloseSocket [line 240]

void _handleCloseSocket( &$socket, resource $socket)

Event on socket close

Invokes when socket closes




Tags:

abstract:  
access:  protected


Parameters:

resource   $socket  
   &$socket  

[ Top ]

method _handleNewSocket [line 249]

void _handleNewSocket( &$socket, resource $socket)

Event on new socket



Tags:

abstract:  
access:  protected


Parameters:

resource   $socket  
   &$socket  

[ Top ]

method _sendDataToSocket [line 131]

boolean _sendDataToSocket( &$socket, string $data, resource $socket)

Sends data to specific socket



Tags:

access:  protected


Parameters:

resource   $socket  
string   $data  
   &$socket  

[ Top ]

method _socketChanged [line 229]

void _socketChanged( &$socket, &$buffer, int $bytes, resource $socket, string $buffer)

Event on socket change

Invokes when socket receives data




Tags:

abstract:  
access:  protected


Parameters:

resource   $socket  
string   $buffer  
int   $bytes  
   &$socket  
   &$buffer  

[ Top ]


Documentation generated on Sat, 17 Apr 2010 22:12:37 +0300 by phpDocumentor 1.4.3