namespace CoreFramework\Listener;
// Import framework stuff
+use CoreFramework\Factory\Connection\ConnectionInfoFactory;
use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Factory\Registry\Socket\SocketRegistryFactory;
+use CoreFramework\Generic\UnsupportedOperationException;
use CoreFramework\Object\BaseFrameworkSystem;
use CoreFramework\Pool\Poolable;
use CoreFramework\Visitor\Visitable;
/**
* Whether we are in blocking or non-blocking mode (default: non-blocking
*/
- private $blockingMode = FALSE;
+ private $blockingMode = false;
/**
* A peer pool instance
$isServerSocket = ((is_resource($socketResource)) && (!@socket_getpeername($socketResource, $peerName)));
// We need to clear the error here if it is a resource
- if ($isServerSocket === TRUE) {
+ if ($isServerSocket === true) {
// Clear the error
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('socketResource[]=' . gettype($socketResource));
socket_clear_error($socketResource);
// Some new peers found?
if ($left < 1) {
// Debug message
- //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE));
+ //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, true));
// Nothing new found
return;
} // END - if
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, true));
// Do we have changed peers?
if (in_array($this->getSocketResource(), $readers)) {
// Output result (only for debugging!)
/*
$option = socket_get_option($newSocket, SOL_SOCKET, SO_RCVTIMEO);
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, TRUE));
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, true));
*/
// Enable SO_OOBINLINE