Generify everything a little

This commit is contained in:
David Majdandžić
2023-03-30 17:50:49 +02:00
parent a34d393c01
commit 2374cba341
10 changed files with 70 additions and 40 deletions

View File

@@ -1,14 +1,17 @@
import {Center} from "../Center/Center";
import {PDU} from "../CommonObjects";
import {PduProcessor} from "./PduProcessor";
export class DebugPduProcessor extends PduProcessor {
servesSessionType: string = Center.name;
serverSessionType: string = Center.name;
processPdu(session: any, pdu: any, ...args: any[]): Promise<any> {
processPdu(session: any, pdu: PDU, ...args: any[]): Promise<any> {
return new Promise<any>((resolve, reject) => {
session.send(pdu.response(), (replyPdu: any) => {
resolve(replyPdu);
});
if (pdu.response) {
session.send(pdu.response(), (replyPdu: any) => {
resolve(replyPdu);
});
}
})
}
}