-
Notifications
You must be signed in to change notification settings - Fork 0
API reference
###Connecting
####connect(host, port, hostname, callback)
Will connect to the specified host
host
The host (which runs the node-dash server) to connect to
port
The port on the host to connect to
hostname
The hostname you want to display in the frontend. Use an empty string ("") to let node-dash generate a hostname for you. The hostname will be generated as follows: machine_name [script_name.js]
callback
Specify a callback function to run when the connection has been established.
####setDebug(debug)
Will disable or enable debug output
debug
Boolean value to enable or disable debug output
###Sending stats
####sendStats([extraData])
Will send the stats to the server
extraData (optional)
Specify optional additional data to be sent to the server.
####sendStatsAutomatically(delay, [extraData])
Will automatically and periodically send the stats to the server
delay
Specify the sending delay. It's in milliseconds, so a delay of 1000 will be equivalent to sending the stats every second.
extraData (optional)
Specify optional additional data to be sent to the server.
####server(port)
Will start a node-dash masterserver at the specified port.
port
Specifies at which port to run the node-dash masterserver