Compare commits

...

2 Commits

Author SHA1 Message Date
424d9cca91 1.1.58 2019-11-08 18:48:39 +01:00
d712270946 fix(core): update 2019-11-08 18:48:39 +01:00
4 changed files with 12 additions and 2 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartsocket",
"version": "1.1.57",
"version": "1.1.58",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartsocket",
"version": "1.1.57",
"version": "1.1.58",
"description": "easy and secure websocket communication",
"main": "dist/index.js",
"typings": "dist/index.d.ts",

View File

@ -112,6 +112,11 @@ export class SmartsocketClient {
});
// handle connection
this.socketConnection.socket.on('connect', async () => {
this.updateStatus('connected');
});
// handle disconnection and errors
this.socketConnection.socket.on('disconnect', async () => {
await this.disconnect();

View File

@ -68,6 +68,11 @@ export class SocketConnection {
// standard behaviour that is always true
allSocketConnections.add(this);
// handle connection
this.socket.on('connect', async () => {
this.updateStatus('connected');
});
this.socket.on('disconnect', async () => {
plugins.smartlog.defaultLogger.log(
'info',