summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
+ };
+
+});