Compare commits

..

6 Commits

Author SHA1 Message Date
c0dad3a977 1.2.2 2021-01-23 05:50:02 +00:00
a921033cc4 fix(core): update 2021-01-23 05:50:02 +00:00
21e4712b04 1.2.1 2021-01-23 04:12:56 +00:00
df43bc2974 fix(core): update 2021-01-23 04:12:55 +00:00
564988185d 1.2.0 2020-12-26 18:06:23 +00:00
8442f3570f feat(SmartsocketClient): socket client can now be stopped with .stop() addiditionally to .reconnect(), which will still try to re 2020-12-26 18:06:22 +00:00
4 changed files with 12 additions and 3 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@@ -13,7 +13,7 @@ let testSocketFunction1: smartsocket.SocketFunction<any>;
let myseServer: smartexpress.Server;
const testConfig = {
port: 3005,
port: 3000,
};
// class smartsocket

View File

@@ -85,6 +85,7 @@ export class SmartsocketClient {
socket: await socketIoClient.connect(socketUrl, {
multiplex: false,
reconnectionAttempts: 5,
rejectUnauthorized: socketUrl.startsWith('https://localhost') ? false : true,
}),
});
@@ -163,6 +164,14 @@ export class SmartsocketClient {
}
}
/**
* stops the client completely
*/
public async stop() {
this.autoReconnect = false;
await this.disconnect();
}
/**
* try a reconnection
*/