]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/listener/udp/class_UdpListener.php
Improved many debug lines with method's name.
[hub.git] / application / hub / main / listener / udp / class_UdpListener.php
index bda5a8b3868d54ad3def283ba72676512b35303a..3e27edafd77e9b3c338974fefd553e6a52e866d7 100644 (file)
@@ -74,7 +74,7 @@ class UdpListener extends BaseListener implements Listenable {
                 * that all connections on this port are now our resposibility to
                 * send/recv data, disconnect, etc..
                 */
-               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __LINE__ . ']: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort());
+               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: 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'));
@@ -94,7 +94,7 @@ class UdpListener extends BaseListener implements Listenable {
                } // END - if
 
                // Now, we want non-blocking mode
-               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __LINE__ . ']: Setting non-blocking mode.');
+               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: 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'));
@@ -114,7 +114,7 @@ class UdpListener extends BaseListener implements Listenable {
                } // END - if
 
                // Set the option to reuse the port
-               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __LINE__ . ']: Setting re-use address option.');
+               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: 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'));
@@ -143,7 +143,7 @@ class UdpListener extends BaseListener implements Listenable {
                $this->setHandlerInstance($handlerInstance);
 
                // Output message
-               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __LINE__ . ']: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
+               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
        }
 
        /**
@@ -173,7 +173,7 @@ class UdpListener extends BaseListener implements Listenable {
                        return;
                } elseif ($lastError > 0) {
                        // Other error detected
-                       self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __LINE__ . ']: Error detected: ' . socket_strerror($lastError));
+                       self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Error detected: ' . socket_strerror($lastError));
 
                        // Skip further processing
                        return;
@@ -183,7 +183,7 @@ class UdpListener extends BaseListener implements Listenable {
                } // END - if
 
                // Debug only
-               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __LINE__ . ']: Handling UDP package with size ' . strlen($rawData) . ' from peer ' . $peer . ':' . $port);
+               self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Handling UDP package with size ' . strlen($rawData) . ' from peer ' . $peer . ':' . $port);
        }
 
        /**