INTRO
The heart.js module provides client HEART protocol implementation. The size of heart.js is 1152 bytes.
CONFIG
Configuration consists of: 1) current transport; 2) array of available transports; 3) reconnection delay; 4) threshold of maximum reconnects.
ct = 0;
transports = [ $ws ];
reconnectDelay = 1000;
maxReconnects = 100;
TRANSPORT
Transport contains PING interval. On hearbeat ws.send('PING') is performed.
$ws = { heart: true,
interval: 5000,
creator: function(url) { },
onheartbeat: function() { } }
CONNECTION
$conn = { onopen: nop,
onmessage: nop,
onclose: nop,
onconnect: nop,
send: function(data) { },
close: function() { } }
You may also want to read: bert.js, utf8.js, mq.js, nitro.js, n2o.js.