[TASK] Added the reconnect-flag that works now.
This commit is contained in:
@@ -50,6 +50,8 @@ class Connection_ConnectionPool {
|
||||
public function createTcpConnection($group = "", $protocol = "RAW", $IPv6 = FALSE) {
|
||||
$socket = $this->socketPool->createTcpSocket($IPv6);
|
||||
$connectionHandler = new Connection_ConnectionHandler($socket, $this->nextID, $group, $protocol);
|
||||
$connectionHandler->setIPv6($IPv6);
|
||||
$connectionHandler->injectConnectionPool($this);
|
||||
$this->addConnectionHandler($connectionHandler);
|
||||
return $connectionHandler;
|
||||
}
|
||||
@@ -117,13 +119,13 @@ class Connection_ConnectionPool {
|
||||
$connectionHandler = $this->getConnectionHandlerForSocketRessource($socket);
|
||||
switch($selectedType) {
|
||||
case "read":
|
||||
if($connectionHandler->isServer() === FALSE) {
|
||||
if($connectionHandler->readToBuffer() === FALSE) $this->removeConnectionHandler($connectionHandler);
|
||||
} else {
|
||||
if($connectionHandler->isServer() === TRUE) {
|
||||
$acceptedSocket = $connectionHandler->accept();
|
||||
$acceptedSocketHandler = new Connection_ConnectionHandler($acceptedSocket, $this->nextID, $connectionHandler->getGroup(), $connectionHandler->getProtocol());
|
||||
$acceptedSocketHandler->hasBeenAccepted();
|
||||
$this->addConnectionHandler($acceptedSocketHandler);
|
||||
} else {
|
||||
$connectionHandler->readToBuffer();
|
||||
}
|
||||
break;
|
||||
case "write":
|
||||
|
||||
Reference in New Issue
Block a user