*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
const EXCEPTION_BASE64_ENCODING_NOT_MODULO_4 = 0x905;
const EXCEPTION_NODE_SESSION_ID_NOT_VERIFYING = 0x906;
const EXCEPTION_REQUEST_NOT_ACCEPTED = 0x907;
- const SOCKET_ERROR_CONNECTION_RESET_BY_PEER = 0x908;
+ const EXCEPTION_DHT_BOOTSTRAP_NOT_ACCEPTED = 0x908;
+ const EXCEPTION_MULTIPLE_MESSAGE_SENT = 0x909;
+ const EXCEPTION_DHT_BOOTSTRAP_NOT_ATTEMPTED = 0x90a;
// Message status codes
const MESSAGE_STATUS_CODE_OKAY = 'OKAY';
*/
private $nodeInstance = NULL;
+ /**
+ * An instance of a communicator
+ */
+ private $communicatorInstance = NULL;
+
+ /**
+ * An instance of a crawler
+ */
+ private $crawlerInstance = NULL;
+
/**
* An instance of a cruncher
*/
private $cruncherInstance = NULL;
+ /**
+ * An instance of a miner
+ */
+ private $minerInstance = NULL;
+
/**
* Listener instance
*/
*/
private $assemblerInstance = NULL;
+ /**
+ * Name of used protocol
+ */
+ private $protocolName = 'invalid';
+
/**
* Protected constructor
*
$this->nodeInstance = $nodeInstance;
}
+ /**
+ * Getter for communicator instance
+ *
+ * @return $communicatorInstance An instance of a Communicator class
+ */
+ public final function getCommunicatorInstance () {
+ return $this->communicatorInstance;
+ }
+
+ /**
+ * Setter for communicator instance
+ *
+ * @param $communicatorInstance An instance of a Communicator class
+ * @return void
+ */
+ protected final function setCommunicatorInstance (Communicator $communicatorInstance) {
+ $this->communicatorInstance = $communicatorInstance;
+ }
+
+ /**
+ * Getter for crawler instance
+ *
+ * @return $crawlerInstance An instance of a Crawler class
+ */
+ public final function getCrawlerInstance () {
+ return $this->crawlerInstance;
+ }
+
+ /**
+ * Setter for crawler instance
+ *
+ * @param $crawlerInstance An instance of a Crawler class
+ * @return void
+ */
+ protected final function setCrawlerInstance (Crawler $crawlerInstance) {
+ $this->crawlerInstance = $crawlerInstance;
+ }
+
/**
* Getter for cruncher instance
*
$this->cruncherInstance = $cruncherInstance;
}
+ /**
+ * Getter for miner instance
+ *
+ * @return $minerInstance An instance of a miner miner
+ */
+ public final function getMinerInstance () {
+ return $this->minerInstance;
+ }
+
+ /**
+ * Setter for miner instance
+ *
+ * @param $minerInstance An instance of a miner miner
+ * @return void
+ */
+ protected final function setMinerInstance (MinerHelper $minerInstance) {
+ $this->minerInstance = $minerInstance;
+ }
+
/**
* Setter for listener instance
*
$errorName = BaseRawDataHandler::SOCKET_ERROR_RESOURCE_UNAVAILABLE;
break;
+ case 32: // "Broken pipe"
+ $errorName = BaseRawDataHandler::SOCKET_ERROR_BROKEN_PIPE;
+ break;
+
case 104: // "Connection reset by peer"
$errorName = BaseRawDataHandler::SOCKET_ERROR_CONNECTION_RESET_BY_PEER;
break;
default: // Everything else <> 0
// Unhandled error code detected, so first debug it because we may want to handle it like the others
- self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] UNKNOWN ERROR CODE = ' . $errorCode . ', MESSAGE = ' . socket_strerror($errorCode));
+ self::createDebugInstance(__CLASS__)->debugOutput('BASE-HUB[' . __METHOD__ . ':' . __LINE__ . '] UNKNOWN ERROR CODE = ' . $errorCode . ', MESSAGE = ' . socket_strerror($errorCode));
// Change it only in this class
$errorName = BaseRawDataHandler::SOCKET_ERROR_UNKNOWN;
// Return result
return $stateName;
}
+
+ /**
+ * Getter for protocol name
+ *
+ * @return $protocolName Name of used protocol
+ */
+ public final function getProtocolName () {
+ return $this->protocolName;
+ }
+
+ /**
+ * Setter for protocol name
+ *
+ * @param $protocolName Name of used protocol
+ * @return void
+ */
+ protected final function setProtocolName ($protocolName) {
+ $this->protocolName = $protocolName;
+ }
}
// [EOF]