summaryrefslogtreecommitdiff
path: root/examples/webchannel/nodejs/chatclient.js
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-20 11:38:57 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-20 11:38:57 +0200
commitba755c28ea0cd35cfa9d8c77ef7f2c61437ad25b (patch)
tree3379cee43d6acae95312e51e6cd05c3c4198a95e /examples/webchannel/nodejs/chatclient.js
parent749951c19cbb7d301bed20f24d16dd4e713485c2 (diff)
parentd84318e98aa3cbac11b4f95b3581e95aab96a34a (diff)
downloadqtwebchannel-5.10.0-beta3.tar.gz
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta3v5.10.0-beta2v5.10.0-beta1
Change-Id: I54f0bcd46ffb496156e46d723275cdd29601e45c
Diffstat (limited to 'examples/webchannel/nodejs/chatclient.js')
-rw-r--r--examples/webchannel/nodejs/chatclient.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/webchannel/nodejs/chatclient.js b/examples/webchannel/nodejs/chatclient.js
index 5e458f2..76b620c 100644
--- a/examples/webchannel/nodejs/chatclient.js
+++ b/examples/webchannel/nodejs/chatclient.js
@@ -91,7 +91,10 @@ var createWebChannel = function(transport, rlif) {
console.log(' << ' + message);
rlif.prompt();
// Go to end of existing input if any
- rlif.write(null, {ctrl: true, name: 'e'})
+ rlif.write(null, {
+ ctrl: true,
+ name: 'e'
+ })
});
rlif.on('line', function(line) {
@@ -118,7 +121,9 @@ socket.on('open', function(event) {
var transport = {
// We cant't do 'send: socket.send' here
// because 'send' wouldn't be bound to 'socket'
- send: function(data) {socket.send(data)}
+ send: function(data) {
+ socket.send(data)
+ }
};
createWebChannel(transport, createReadlineInterface());
@@ -131,12 +136,12 @@ socket.on('open', function(event) {
});
});
-socket.on('error', function (error) {
+socket.on('error', function(error) {
console.log('Connection error: ' + error.message);
process.exit(1);
});
-socket.on('close', function () {
+socket.on('close', function() {
console.log('Connection closed.');
process.exit(1);
});