*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
/**
* Used protocol (Default: invalid, which is indeed invalid...)
*/
- private $protcol = 'invalid';
+ private $protocol = 'invalid';
/**
* Address (IP mostly) we shall listen on
private $blockingMode = false;
/**
- * A client pool instance
+ * A peer pool instance
*/
private $poolInstance = null;
- /**
- * A network package handler instance
- */
- private $packageInstance = null;
-
/**
* Protected constructor
*
}
/**
- * Setter for client pool instance
+ * Setter for peer pool instance
*
- * @param $poolInstance The client pool instance we shall set
+ * @param $poolInstance The peer pool instance we shall set
* @return void
*/
- protected final function setPoolInstance (PoolableClient $poolInstance) {
+ protected final function setPoolInstance (PoolablePeer $poolInstance) {
$this->poolInstance = $poolInstance;
}
/**
- * Getter for client pool instance
+ * Getter for peer pool instance
*
- * @return $poolInstance The client pool instance we shall set
+ * @return $poolInstance The peer pool instance we shall set
*/
- protected final function getPoolInstance () {
+ public final function getPoolInstance () {
return $this->poolInstance;
}
- /**
- * Setter for network package handler instance
- *
- * @param $packageInstance The network package handler instance we shall set
- * @return void
- */
- protected final function setPackageInstance (Networkable $packageInstance) {
- $this->packageInstance = $packageInstance;
- }
-
- /**
- * Getter for network package handler instance
- *
- * @return $packageInstance The network package handler instance we shall set
- */
- protected final function getPackageInstance () {
- return $this->packageInstance;
- }
-
/**
* Registeres the given socket resource for "this" listener instance. This
* will be done in a seperate class to allow package writers to use it
*/
public function accept (Visitor $visitorInstance) {
// Debug message
- //* DEBUG: */ $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - START');
+ //* DEBUG: */ $this->debugOutput(strtoupper($this->getProtocol()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - START');
// Visit this listener
$visitorInstance->visitListener($this);
} // END - if
// Debug message
- //* DEBUG: */ $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - FINISHED');
+ //* DEBUG: */ $this->debugOutput(strtoupper($this->getProtocol()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - FINISHED');
+ }
+
+ /**
+ * Monitors incoming raw data from the handler and transfers it to the
+ * given receiver instance. This method should not be called, please call
+ * the decorator's version instead to seperator node/client traffic.
+ *
+ * @param $receiverInstance An instance of a Receivable class
+ * @return void
+ * @throws UnsupportedOperatorException If this method is called by a mistake
+ */
+ public function monitorIncomingRawData (Receivable $receiverInstance) {
+ throw new UnsupportedOperationException(array($this, __FUNCTION__, $receiverInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
}
}