* @param $nodeInstance A NodeHelper instance
* @return $listenerInstance An instance a prepared listener class
*/
- public final static function createTcpListener (NodeHelper $nodeInstance) {
+ public static final function createTcpListener (NodeHelper $nodeInstance) {
// Get new instance
$listenerInstance = new TcpListener();
* "Listens" for incoming network packages
*
* @return void
+ * @throws InvalidSocketException If an invalid socket resource has been found
*/
public function doListen () {
// Get all readers
// Shutdown this socket
$this->shutdownSocket($newSocket);
- // And throw again
+ // And throw the exception
throw new InvalidSocketException(array($this, gettype($newSocket), $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET);
} // END - if
} // END - if
// Get the current value
- $current = $this->getIteratorInstance()->current();
+ $currentSocket = $this->getIteratorInstance()->current();
// Handle it here, if not main socket
- if ($current != $this->getSocketResource()) {
+ if ($currentSocket != $this->getSocketResource()) {
// ... or else it will raise warnings like 'Transport endpoint is not connected'
- $this->getPackageInstance()->processResourcePackage($current);
+ $this->getPackageInstance()->processResourcePackage($currentSocket);
} // END - if
// Advance to next entry. This should be the last line