]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/listener/udp/class_UdpListener.php
'public static final' is the right thing, some variables renamed to make clear what...
[hub.git] / application / hub / main / listener / udp / class_UdpListener.php
index 1f34a8b1aaa606a6cfaff713dc5d399e8d862f3f..04c791eede8aa685ee3ced9aaaa097a297d847ce 100644 (file)
@@ -38,7 +38,7 @@ class UdpListener extends BaseListener implements Listenable {
         * @param       $nodeInstance           A NodeHelper instance
         * @return      $listenerInstance       An instance a prepared listener class
         */
-       public final static function createUdpListener (NodeHelper $nodeInstance) {
+       public static final function createUdpListener (NodeHelper $nodeInstance) {
                // Get new instance
                $listenerInstance = new UdpListener();
 
@@ -133,7 +133,7 @@ class UdpListener extends BaseListener implements Listenable {
         * @todo        ~50% done
         */
        public function doListen() {
-               // Read a package and determine the client
+               // Read a package and determine the peer
                $amount = @socket_recvfrom($this->getSocketResource(), $pkt, 1500, 0, $peer, $port);
 
                // Get last error
@@ -165,6 +165,16 @@ class UdpListener extends BaseListener implements Listenable {
                // Debug only
                $this->debugOutput('LISTENER: Handling UDP package with size ' . strlen($pkt) . ' from peer ' . $peer . ':' . $port);
        }
+
+       /**
+        * Checks wether the listener would accept the given package data array
+        *
+        * @param       $packageData    Raw package data
+        * @return      $accepts                Wether this listener does accept
+        */
+       function ifListenerAcceptsPackageData (array $packageData) {
+               $this->partialStub('This call should not happen. Please report it.');
+       }
 }
 
 // [EOF]