summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-12-28 17:28:26 +0200
committerLV-426 <lv-426@taproot.org.il>2014-12-28 17:28:26 +0200
commite4be5638c188824e82a5bbd7641a386e2fba39f4 (patch)
tree1d55bbea28f00575d96cac414f94d50046d829ed /src/client
parente3d56f8cf68af8f1db8858ef8f4a02a381d46ac6 (diff)
initial rz_mesh.js module
Diffstat (limited to 'src/client')
-rw-r--r--src/client/rz_mesh.js29
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
+ };
+
+});