help | logout
RSP_server

RSP_server

Name

RSP_server -- Creates an object for an RSPD connection.

Synopsis

$node = rsplib::RSP_server(host, port, timeout, persistent);

Description

Creates an object which will be used to gather information from an RSPD server. Use this constructor to create an RSP_server object, from which you will call the other server functions.

The parameters host and port specify the location of the server on the network. If host is not an IP address the function will attempt to do a DNS lookup. The persistent parameter should be 0 or 1 to specify if a persistent connection is desired. If turned off, a call to connect() will cause RSP Lib to connect to the RSPD, gather its data, then disconnect. Therefore each time that function is called a new connection will be established. If persistent connections are specified, the first call to connect() will initiate a connection but not close it. Each time the function is called after that the same connection will be used to gather data. The connection is finally ended when the object is freed. If persistent connections are used, you may use sendKeepAlive() to send a keep alive packet to the RSPD to make sure the connection is still active.

Returns

The module object, from which all other module functions are referenced. In case of error, the program will croak() with an appriopriate message.