application/hub/main/states/peer/errors/class_ConnectionTimedOutPeerState.php svneol=native#text/plain
application/hub/main/states/peer/errors/class_NoRouteToHostPeerState.php svneol=native#text/plain
application/hub/main/states/peer/errors/class_OperationAlreadyProgressPeerState.php svneol=native#text/plain
+application/hub/main/states/peer/errors/class_ProblemPeerState.php svneol=native#text/plain
application/hub/main/states/peer/errors/class_TransportEndpointGonePeerState.php svneol=native#text/plain
application/hub/main/states/peer/init/.htaccess -text svneol=unset#text/plain
application/hub/main/states/peer/init/class_InitPeerState.php svneol=native#text/plain
// CFG: PEER-CONNECTED-STATE-CLASS
$cfg->setConfigEntry('peer_connected_state_class', 'ConnectedPeerState');
+// CFG: PEER-PROBLEM-STATE-CLASS
+$cfg->setConfigEntry('peer_problem_state_class', 'ProblemPeerState');
+
// CFG: PEER-CONNECTION-REFUSED-STATE-CLASS
$cfg->setConfigEntry('peer_connection_refused_state_class', 'ConnectionRefusedPeerState');
}
} // END - while
+ // Is the peer connected?
+ if ($isConnected === true) {
+ // Connection is fully established here, so change the state.
+ PeerStateFactory::createPeerStateInstanceByName('connected', $this);
+ } else {
+ /*
+ * There was a problem connecting to the peer (this state is a meta
+ * state until the error handler has found the real cause).
+ */
+ PeerStateFactory::createPeerStateInstanceByName('problem', $this);
+ }
+
// Return status
return $isConnected;
}
--- /dev/null
+<?php
+/**
+ * A Problem peer state class
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @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
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ProblemPeerState extends BasePeerState implements PeerStateable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set state name
+ $this->setStateName(BaseRawDataHandler::SOCKET_ERROR_UNKNOWN);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $stateInstance An instance of a PeerStateable class
+ */
+ public final static function createProblemPeerState () {
+ // Get new instance
+ $stateInstance = new ProblemPeerState();
+
+ // Return the prepared instance
+ return $stateInstance;
+ }
+}
+
+// [EOF]
+?>