Commit 09131ea9 authored by legoc's avatar legoc
Browse files

Added output for web socket events (open, close, error)

parent aad438b5
......@@ -16,6 +16,18 @@ class WebReceiver extends Receiver {
}
}
});
this._wss.addEventListener('open', (event) => {
console.log('receiver socket opened');
});
this._wss.addEventListener('close', (event) => {
console.log('receiver socket closed');
});
this._wss.addEventListener('error', (event) => {
console.log('receiver socket error');
});
}
on(event, callback) {
......
......@@ -15,6 +15,18 @@ class WebRequester extends Requester {
this._listeners[packet.event](packet.data);
}
});
this._wss.addEventListener('open', (event) => {
console.log('requester socket opened');
});
this._wss.addEventListener('close', (event) => {
console.log('requester socket closed');
});
this._wss.addEventListener('error', (event) => {
console.log('requester socket error');
});
}
// The onReady function is used to ensure that the web socket is ready before sending a request.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment