Fix issue with WS not sending any updates for Centers

This commit is contained in:
David Majdandžić
2023-04-03 17:49:23 +02:00
parent f3917090f7
commit 3856fcecbd
3 changed files with 20 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"body-parser": "^1.20.2", "body-parser": "^1.20.2",
"compression": "^1.7.4",
"express": "^4.18.2", "express": "^4.18.2",
"nanotimer": "^0.3.15", "nanotimer": "^0.3.15",
"smpp": "^0.6.0-rc.4", "smpp": "^0.6.0-rc.4",

View File

@@ -10,7 +10,7 @@ export class CenterSessionManager extends SessionManager {
ManagedSessionClass: typeof Center = Center; ManagedSessionClass: typeof Center = Center;
sessionId: number = 0; sessionId: number = 0;
sessions: Center[] = []; sessions: Center[] = [];
identifier: string = "Client"; identifier: string = "Center";
readonly logger: Logger = new Logger("CenterSessionManager"); readonly logger: Logger = new Logger("CenterSessionManager");
constructor() { constructor() {

View File

@@ -1,4 +1,6 @@
import {Center} from "./Center/Center";
import {CenterSessionManager} from "./Center/CenterSessionManager"; import {CenterSessionManager} from "./Center/CenterSessionManager";
import {Client} from "./Client/Client";
import ClientSessionManager from "./Client/ClientSessionManager"; import ClientSessionManager from "./Client/ClientSessionManager";
import {HttpServer} from "./HttpServer/HttpServer"; import {HttpServer} from "./HttpServer/HttpServer";
import Logger from "./Logger"; import Logger from "./Logger";
@@ -29,6 +31,22 @@ function cleanup(): void {
process.exit(0); process.exit(0);
} }
async function main() {
let client: Client = await clientManager.getSession(0) as Client
let center: Center = await centerManager.getSession(0) as Center;
setInterval(async () => {
await client.doConnect();
setTimeout(async () => {
await client.doBind();
setTimeout(async () => {
await center.close();
}, 1000);
}, 1000);
}, 3000);
}
// main();
// process.on('exit', cleanup); // process.on('exit', cleanup);
// process.on('SIGINT', cleanup); // process.on('SIGINT', cleanup);
// process.on('SIGUSR1', cleanup); // process.on('SIGUSR1', cleanup);