[TASK] Did some small changes in the code. Also updated some comments.
This commit is contained in:
@@ -66,24 +66,24 @@ class Connection_ConnectionPool {
|
||||
|
||||
/**
|
||||
* Adds a ConnectionHandler to the pool.
|
||||
* @param Connection_ConnectionHandler $add_connectionHandler
|
||||
* @param Connection_ConnectionHandler $addConnectionHandler
|
||||
* @return void
|
||||
*/
|
||||
public function addConnectionHandler($add_connectionHandler) {
|
||||
array_push($this->connectionHandlers, $add_connectionHandler);
|
||||
public function addConnectionHandler($addConnectionHandler) {
|
||||
array_push($this->connectionHandlers, $addConnectionHandler);
|
||||
$this->nextID++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a ConnectionHandler from the pool.
|
||||
* @param Connection_ConnectionHandler $remove_connectionHandler
|
||||
* @param Connection_ConnectionHandler $removeConnectionHandler
|
||||
* @return void
|
||||
*/
|
||||
public function removeConnectionHandler($remove_connectionHandler) {
|
||||
public function removeConnectionHandler($removeConnectionHandler) {
|
||||
foreach($this->connectionHandlers AS $key=>$connectionHandler) {
|
||||
if($connectionHandler === $remove_connectionHandler) {
|
||||
$this->socketPool->removeSocket($remove_connectionHandler->getSocket());
|
||||
$remove_connectionHandler->close();
|
||||
if($connectionHandler === $removeConnectionHandler) {
|
||||
$this->socketPool->removeSocket($removeConnectionHandler->getSocket());
|
||||
$removeConnectionHandler->close();
|
||||
unset($this->connectionHandlers[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user