+ /**
+ * Checks wether the given socket resource is a server socket
+ *
+ * @param $socketResource A valid socket resource
+ * @return $isServerSocket Wether the socket resource is a server socket
+ */
+ protected function isServerSocketResource ($socketResource) {
+ // Check it
+ $isServerSocket = ((is_resource($socketResource)) && (!@socket_getpeername($socketResource, $peerName)));
+
+ // We need to clear the error here if it is a resource
+ if ($isServerSocket === true) {
+ // Clear the error
+ //* DEBUG: */ $this->debugOutput('socketResource[]=' . gettype($socketResource));
+ socket_clear_error($socketResource);
+ } // END - if
+
+ // Check peer name, it must be empty
+ $isServerSocket = (($isServerSocket) && (empty($peerName)));
+
+ // Return result
+ return $isServerSocket;
+ }
+