diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-12-28 17:28:26 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-12-28 17:28:26 +0200 |
| commit | e4be5638c188824e82a5bbd7641a386e2fba39f4 (patch) | |
| tree | 1d55bbea28f00575d96cac414f94d50046d829ed | |
| parent | e3d56f8cf68af8f1db8858ef8f4a02a381d46ac6 (diff) | |
initial rz_mesh.js module
| -rw-r--r-- | src/client/rz_mesh.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/client/rz_mesh.js b/src/client/rz_mesh.js new file mode 100644 index 00000000..89c75c7c --- /dev/null +++ b/src/client/rz_mesh.js @@ -0,0 +1,29 @@ +"use strict" + +/** + * Manage backend websocket connection + */ +define([ 'rz_config' ], function(rz_config) { + + var rz_server_url = 'http://' + rz_config.rz_server_host + ':' + + rz_config.rz_server_port; + + function init() { + var socket = io.connect(rz_server_url + '/graph', { + 'reconnection' : true, // TODO: limit reconnection attempts + 'reconnectionDelay': 3000, + }); + + // wire up event handlers + socket.on('diff_commit__topo', diff_merge__topo); + } + + function diff_merge__topo(topo_diff) { + console.log('ws: rx: diff_merge__topo') + } + + return { + init : init + }; + +}); |
