[TASK] Code cleanup and some small documentation.
This commit is contained in:
@@ -90,8 +90,8 @@ class Client_ClientManager {
|
||||
//assign the client to the new connectionHandler.
|
||||
$this->clientPool[$newConnectionHandler->getID()] = $client;
|
||||
//get the config and assign it to the new connectionHandler, too.
|
||||
$config = $this->configPool[$connectionHandler->getID()];
|
||||
$this->configPool[$newConnectionHandler->getID()] = $config;
|
||||
$config = $this->configPool[$connectionHandler->getID()];
|
||||
$this->configPool[$newConnectionHandler->getID()] = $config;
|
||||
//remove old connection
|
||||
$this->removeConnection($connectionHandler);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class Client_ClientManager {
|
||||
}
|
||||
//call the registered client
|
||||
if(isset($this->clientPool[$connectionHandler->getID()])) {
|
||||
//let the client process the data, send the results back.
|
||||
//let the client process the data, send the results back.
|
||||
while($data = $connectionHandler->read()) {
|
||||
$result = $this->clientPool[$connectionHandler->getID()]->processRawData($data);
|
||||
if($result !== "") {
|
||||
|
||||
@@ -111,7 +111,7 @@ class Connection_ConnectionPool {
|
||||
if($connectionHandler->canWrite() && $connectionHandler->isServer() === FALSE) $write[] = $connectionSocket;
|
||||
}
|
||||
$except = $read;
|
||||
|
||||
//Arrays are prepared, let's have socket_select() take a look and process its results.
|
||||
$tempArray = array();
|
||||
$selectedSockets = $this->socketPool->select($read, $write, $except);
|
||||
foreach($selectedSockets AS $selectedType=>$selectedArray) { //read, write, except, this loop won't kill performance
|
||||
|
||||
Reference in New Issue
Block a user