From: Roland Haeder Date: Tue, 22 Dec 2015 20:53:53 +0000 (+0100) Subject: Yepp, the 2nd check was double + re-aranged the log messages that before X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4140ec0c3d51dfab2dff95fb8b5895821b90238d;p=hub.git Yepp, the 2nd check was double + re-aranged the log messages that before clearing "operation in progress" all original data is logged. Signed-off-by: Roland Haeder --- diff --git a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php index f1dfa8305..895acb9ac 100644 --- a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php @@ -157,6 +157,9 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { } } // END - while + // Log error code + /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); + /* * All IPv4-based connections are non-blocking used by this program or * else the PHP process will "hang" until a peer connects which is not @@ -164,6 +167,9 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { * isConnected=FALSE here. */ if (($hasTimedOut === FALSE) && ($socketError == SOCKET_EINPROGRESS)) { + // Debug message + /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Clearing "operation in progress" as this is for 99.999% chance a non-blocking I/O operation.'); + // A "connection in progress" has not timed out. All fine. $isConnected = TRUE; @@ -171,11 +177,8 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { socket_clear_error($socketResource); } // END - if - // Log error code - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); - // Is the peer connected? - if (($isConnected === TRUE) || (($socketError == SOCKET_EINPROGRESS) && ($hasTimedOut === FALSE))) { + if ($isConnected === TRUE) { // Connection is fully established here, so change the state. PeerStateFactory::createPeerStateInstanceByName('connected', $this); } else {