Diffusion JS API のコード例をいくつか調べていますが、再接続の例がわかりません。reconnectionStrategy のパラメータstart
とパラメータは何ですか?abort
// Create a reconnection strategy that applies an exponential back-off
var reconnectionStrategy = (function() {
return function(start, abort) {
var wait = Math.min(Math.pow(2, attempts++) * 100, maximumAttemptInterval);
// Wait and then try to start the reconnection attempt
setTimeout(start, wait);
};
})();
// Connect to the server.
diffusion.connect({
host : 'diffusion.example.com',
port : 443,
secure : true,
principal : 'control',
credentials : 'password',
reconnect : {
timeout : maximumTimeoutDuration,
strategy : reconnectionStrategy
}
}).then(function(session) {
https://github.com/pushtechnology/diffusion-examples/blob/master/js/examples/reconnect.jsから取得