test stuff
parent
ae20cb579d
commit
ccc41e1eb3
|
@ -63,6 +63,16 @@ R3.Socket.prototype.createInstance = function() {
|
||||||
|
|
||||||
this.instance = new WebSocket(this.server.getURL());
|
this.instance = new WebSocket(this.server.getURL());
|
||||||
|
|
||||||
|
// Connection opened
|
||||||
|
this.instance.addEventListener('open', function (event) {
|
||||||
|
this.instance.send('Hello Server!');
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
// Listen for messages
|
||||||
|
this.instance.addEventListener('message', function (event) {
|
||||||
|
console.log('Message from server ', event.data);
|
||||||
|
});
|
||||||
|
|
||||||
R3.Component.prototype.createInstance.call(this);
|
R3.Component.prototype.createInstance.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue