nextServerModule

Name

nextServerModule -- Returns next module data structure in chain.

Synopsis

$module = $node->nextServerModule();

Description

This function will return the next RSP_module structure as retrieved by connect(). If all modules have already been returned, then undef is returned and the pointer to the current module is reset to the beginning of the list (so the next call to this function will return the first element, and the second after that, and so on).

The module object returned contains three elements, name, data, and threshold, which are referenced with getName(), getData(), and getThreshCrossed(). Here is an example of how to use this function:

# Assuming $node has already been created
$node->connect();

while(defined($module = $node->nextServerModule())) {
	print "Name: " . $module->getName() . "\n";
	print "Data: " . $module->getData() . "\n";
	print "Threshold: " . $module->getThreshCrossed() . "\n";
}
				

Returns

The next RSP_module object, as downloaded from the RSPD in a previous call to connect(). Undefined is returned when the end of the list is reached or there is an error. In case of error, the program will croak() with an appriopriate message.