- throw new InvalidSocketException(array($this, gettype($mainSocket), $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET);
+ throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET);
+ */
+ } // END - if
+
+ // Now, we want non-blocking mode
+ $this->debugOutput('TCP-LISTENER: Setting non-blocking mode.');
+ if (!socket_set_nonblock($mainSocket)) {
+ // Handle this socket error with a faked recipientData array
+ $this->handleSocketError($mainSocket, array('0.0.0.0', '0'));
+ /*
+ // Get socket error code for verification
+ $socketError = socket_last_error($mainSocket);
+
+ // Get error message
+ $errorMessage = socket_strerror($socketError);
+
+ // Shutdown this socket
+ $this->shutdownSocket($mainSocket);
+
+ // And throw again
+ throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET);
+ */