* that all connections on this port are now our resposibility to
* send/recv data, disconnect, etc..
*/
- $this->debugOutput('UDP-LISTENER: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort());
+ self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort());
if (!socket_bind($mainSocket, $this->getListenAddress(), $this->getListenPort())) {
// Handle the socket error with a faked recipientData array
$this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0'));
} // END - if
// Now, we want non-blocking mode
- $this->debugOutput('UDP-LISTENER: Setting non-blocking mode.');
+ self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER: Setting non-blocking mode.');
if (!socket_set_nonblock($mainSocket)) {
// Handle the socket error with a faked recipientData array
$this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0'));
} // END - if
// Set the option to reuse the port
- $this->debugOutput('UDP-LISTENER: Setting re-use address option.');
+ self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER: Setting re-use address option.');
if (!socket_set_option($mainSocket, SOL_SOCKET, SO_REUSEADDR, 1)) {
// Handle the socket error with a faked recipientData array
$this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0'));
$this->setHandlerInstance($handlerInstance);
// Output message
- $this->debugOutput('UDP-LISTENER: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
+ self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
}
/**
return;
} elseif ($lastError > 0) {
// Other error detected
- $this->debugOutput('UDP-LISTENER: Error detected: ' . socket_strerror($lastError));
+ self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER: Error detected: ' . socket_strerror($lastError));
// Skip further processing
return;
} // END - if
// Debug only
- $this->debugOutput('UDP-LISTENER: Handling UDP package with size ' . strlen($rawData) . ' from peer ' . $peer . ':' . $port);
+ self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER: Handling UDP package with size ' . strlen($rawData) . ' from peer ' . $peer . ':' . $port);
}
/**