diff --git a/.gitignore b/.gitignore
index ef7d308..cecb95a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@ package-lock.json
sessions.json
client_sessions.json
center_sessions.json
+dist
+main.exe
diff --git a/.run/main.js.run.xml b/.run/main.js.run.xml
deleted file mode 100644
index de16bf6..0000000
--- a/.run/main.js.run.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.run/main.ts.run.xml b/.run/main.ts.run.xml
index 1e97700..4f310e5 100644
--- a/.run/main.ts.run.xml
+++ b/.run/main.ts.run.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/package.json b/package.json
index 8781c26..bf61548 100644
--- a/package.json
+++ b/package.json
@@ -4,8 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
- "pkg:windows": "pkg main.js --target node16-windows-x64 --output main.exe",
- "pkg:linux": "pkg main.js --target node16-linux-x64 --output main.exe"
+ "tsc": "tsc",
+ "pkg:windows": "pkg ./dist/main.js --target node16-windows-x64 --output main.exe",
+ "pkg:linux": "pkg ./dist/main.js --target node16-linux-x64 --output main.exe"
},
"keywords": [],
"author": "",
diff --git a/src/Logger.ts b/src/Logger.ts
index 52fc290..70df548 100644
--- a/src/Logger.ts
+++ b/src/Logger.ts
@@ -1,11 +1,8 @@
-// @ts-ignore
import {WriteStream} from "fs";
const fs = require('fs');
-// @ts-ignore
-const LOG_LEVEL: number = process.env.LOG_LEVEL || 6;
-// @ts-ignore
+const LOG_LEVEL: number = Number(process.env.LOG_LEVEL) || 0;
const LOG_FILE: string = process.env.LOG_FILE || "";
export default class Logger {
diff --git a/src/main.ts b/src/main.ts
index 74a644f..5ff3c0c 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,17 +1,15 @@
import CenterSessionManager from "./Center/CenterSessionManager";
-import Client from "./Client/Client";
import ClientSessionManager from "./Client/ClientSessionManager";
import HttpServer from "./HttpServer/HttpServer";
import Logger from "./Logger";
-import SourceEnumeratorProcessor from "./PDUProcessor/Preprocessor/Client/SourceEnumeratorProcessor";
import ProcessorManager from "./PDUProcessor/ProcessorManager";
import WSServer from "./WS/WSServer";
const {PDU} = require("smpp");
-let logger = new Logger("main");
+let logger: Logger = new Logger("main");
-new ProcessorManager();
+let pm: ProcessorManager = new ProcessorManager();
let clientManager: ClientSessionManager = new ClientSessionManager();
let centerManager: CenterSessionManager = new CenterSessionManager();
@@ -25,31 +23,6 @@ function cleanup(): void {
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);
-
-
- // console.log(ProcessorManager.getProcessorsForType(Client.name));
- // ProcessorManager.attachProcessor(client, ProcessorManager.getProcessor(SourceEnumeratorProcessor.name));
- // await client.doConnect();
- // await client.doBind();
- // client.sendMultipleDefault();
- ProcessorManager.attachProcessor(client, ProcessorManager.getProcessor(SourceEnumeratorProcessor.name));
- console.log("OK");
-}
-
-main();
-
process.on('exit', cleanup);
process.on('SIGINT', cleanup);
process.on('SIGUSR1', cleanup);