* @param $socketProtocol Socket protocol (TCP, UDP, file)
* @param $packageInstance An instance of a DeliverablePackage class
* @param $socketType Socket type (incoming, outgoing, server, file, ...)
- * @return $socketInstance An instance of a StorableSocket class
+ * @return $containerInstance An instance of a StorableSocket class
* @throws InvalidArgumentException If a parameter is not valid
*/
public static final function createSocketContainer (Socket $socketResource, string $socketProtocol, DeliverablePackage $packageInstance, string $socketType) {
}
// Get a new instance
- $socketInstance = new SocketContainer();
+ $containerInstance = new SocketContainer();
// Set all values
- $socketInstance->setSocketProtocol($socketProtocol);
- $socketInstance->setSocketResource($socketResource);
- $socketInstance->setPackageDataInstance($packageInstance);
- $socketInstance->setSocketType($socketType);
+ $containerInstance->setSocketProtocol($socketProtocol);
+ $containerInstance->setSocketResource($socketResource);
+ $containerInstance->setPackageDataInstance($packageInstance);
+ $containerInstance->setSocketType($socketType);
// Set more configuration entries
- self::$configEntries[sprintf('%s_socket_listen_backlog', $socketInstance->getSocketType())] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry(sprintf('%s_socket_listen_backlog', $socketInstance->getSocketProtocol()));
+ self::$configEntries[sprintf('%s_socket_listen_backlog', $containerInstance->getSocketType())] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry(sprintf('%s_socket_listen_backlog', $containerInstance->getSocketProtocol()));
// Return the prepared instance
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: socketInstance=%s - EXIT!', strtoupper($socketProtocol), $socketInstance->__toString()));
- return $socketInstance;
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: containerInstance=%s - EXIT!', strtoupper($socketProtocol), $containerInstance->__toString()));
+ return $containerInstance;
}
/**
*/
public function shutdownSocket () {
// Debug message
- self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-SOCKET: Shutting down socket ' . $this->getSocketResource() . ' with state ' . ($this->getHelperInstance() instanceof Helper ? $this->getHelperInstance()->getPrintableState() : 'NULL') . ' ...');
+ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-SOCKET: Shutting down socket ' . $this->getPrintableName() . ' with state ' . ($this->getHelperInstance() instanceof Helper ? $this->getHelperInstance()->getPrintableState() : 'NULL') . ' ...');
// Get a visitor instance
$visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_socket_visitor_class');
*/
public function halfShutdownSocket () {
// Debug message
- self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-SOCKET: Half-shutting down socket resource ' . $this->getSocketResource() . ' with state ' . $this->getHelperInstance()->getPrintableState() . ' ...');
+ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-SOCKET: Half-shutting down socket resource ' . $this->getPrintableName() . ' with state ' . $this->getHelperInstance()->getPrintableState() . ' ...');
// Get a visitor instance
$visitorInstance = ObjectFactory::createObjectByConfiguredName('half_shutdown_socket_visitor_class');
*/
public function getSocketRecipientUnl () {
// Should be valid socket
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function getSocketRecipientAddress () {
// Should be valid socket
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function getSocketRecipientPort () {
// Should be valid socket
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function isValidSocket () {
// Is it valid?
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
- // @TODO maybe add more checks? is_resource() is still to less
- $isValidSocket = (is_resource($this->getSocketResource()));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
+ // @TODO maybe add more checks? instanceof is still to less
+ $isValidSocket = ($this->getSocketResource() instanceof Socket);
// Return status
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: isValidSocket=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($isValidSocket)));
*/
public function getLastSocketErrorCode () {
// Should be valid socket
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function getLastSocketErrorMessage () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function translateLastSocketErrorCodeToName () {
// Get last error code
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$errorCode = $this->getLastSocketErrorCode();
// Call "translate" method
*/
public function bindSocketToFile () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function bindSocketToListener () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function listenToSocket () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function enableSocketNonBlocking () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function enableSocketReuseAddress () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function connectToSocketRecipient () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function doShutdown () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new BadMethodCallException(sprintf('[%s:%d]: Shutdown on invalid socket. Maybe called already?', __METHOD__, __LINE__), self::EXCEPTION_INVALID_SOCKET, FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
}
// Debug message
- self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-SOCKET: Shutting down socket ' . $this->getSocketResource());
+ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-SOCKET: Shutting down socket ' . $this->getPrintableName());
DebugMiddleware::getSelfInstance()->partialStub('Please rewrite this method.');
return;
*/
public function acceptNewIncomingSocket () {
// Should be valid socket
- /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
}
// Init all arrays, at least readers
- /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: this->socketResource=%s', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: this->socketResource=%s', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$readers = [$this->getSocketResource()];
$writers = [];
$excepts = [];
/* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: left=%d,readers()=%d,writers()=%d,except()=%d) ...', strtoupper($this->getSocketProtocol()), $left, count($readers), count($writers), count($excepts)));
if ($left < 1) {
// Nothing new found
- /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: left=%d,serverSocket=%s,readers()=%d, returning NULL - EXIT!', strtoupper($this->getSocketProtocol()), $left, $this->getSocketResource(), count($readers)));
+ /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: left=%d,serverSocket=%s,readers()=%d, returning NULL - EXIT!', strtoupper($this->getSocketProtocol()), $left, $this->getPrintableName(), count($readers)));
return NULL;
} elseif (!in_array($this->getSocketResource(), $readers)) {
// Abort here
$socketResource = socket_accept($this->getSocketResource());
// Create socket instance from it
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: this->socketResource[]=%s,serverSocket=%s', strtoupper($this->getSocketProtocol()), gettype($socketResource), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: this->socketResource[]=%s,serverSocket=%s', strtoupper($this->getSocketProtocol()), gettype($socketResource), $this->getPrintableName()));
$socketInstance = SocketFactory::createIncomingSocketInstance($socketResource, $this->getSocketProtocol());
// Return accepted socket instance
*/
public function readDataFromSocket () {
// Should be valid socket
- /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
$rawData = socket_read($this->getSocketResource(), FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('tcp_buffer_length'), PHP_BINARY_READ);
// Return it
- /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s,rawData[%s]=%s - EXIT!', strtoupper($this->getSocketProtocol()), $this->getSocketResource(), gettype($rawData), $rawData));
+ /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s,rawData[%s]=%s - EXIT!', strtoupper($this->getSocketProtocol()), $this->getPrintableName(), gettype($rawData), $rawData));
return $rawData;
}
*/
public function identifySocketPeer () {
// Init peer address (IP)/port
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$peerAddress = '0.0.0.0';
$peerPort = 0;
*/
public function setSocketTimeoutOptions () {
// Call setter method with configured values
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$result = $this->setSocketOption(SOL_SOCKET, SO_RCVTIMEO, [
// Seconds
'sec' => FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getSocketProtocol() . '_socket_accept_wait_sec'),
*/
public function enableSocketOutOfBandData () {
// Call inner method
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$result = $this->setSocketOption(SOL_SOCKET, SO_OOBINLINE, 1);
// Return result
*/
public function clearLastSocketError () {
// Should be valid socket
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: Clearing socket error, this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: Clearing socket error, this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
if (!$this->isValidSocket()) {
// Throw exception
throw new InvalidSocketException([$this], self::EXCEPTION_INVALID_SOCKET);
*/
public function registerInfoInstance (ShareableInfo $infoInstance) {
// Get listener/helper from info class
- /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: infoInstance=%s,this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $infoInstance->__toString(), $this->getSocketResource()));
+ /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: infoInstance=%s,this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $infoInstance->__toString(), $this->getPrintableName()));
$listenerInstance = $infoInstance->getListenerInstance();
$helperInstance = $infoInstance->getHelperInstance();
}
// Send buffered raw data
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: Invoking socket_write(%s,()=%d,%d) ...', strtoupper($this->getSocketProtocol()), $this->getSocketResource(), strlen($socketBuffer[NetworkPackageHandler::RAW_INDEX_ENCODED_DATA]), $bufferSize));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-SOCKET: Invoking socket_write(%s,()=%d,%d) ...', strtoupper($this->getSocketProtocol()), $this->getPrintableName(), strlen($socketBuffer[NetworkPackageHandler::RAW_INDEX_ENCODED_DATA]), $bufferSize));
$sentBytes = socket_write($this->getSocketResource(), $socketBuffer[NetworkPackageHandler::RAW_INDEX_ENCODED_DATA], $bufferSize);
// Check if the operation was okay
*/
protected function handleSocketErrorPermissionDenied () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorConnectionTimedOut () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorResourceUnavailable () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorConnectionRefused () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorNoRouteToHost () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorOperationAlreadyProgress () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorConnectionResetByPeer () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorOperationNotSupported () {
// Get socket error code for verification
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
$socketError = $this->getLastSocketErrorCode();
// Get error message
*/
protected function handleSocketErrorOperationInProgress () {
// Very common with non-blocking I/O
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getPrintableName()));
self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(strtoupper($this->getSocketProtocol()) . '-HELPER: Operation is now in progress, this is usual for non-blocking connections and is no bug.');
}