Implement source and desination enumerators for client
This commit is contained in:
@@ -35,8 +35,8 @@ export class Center extends SmppSession {
|
||||
this._password = password;
|
||||
this.port = port;
|
||||
|
||||
this._defaultSingleJob = Job.createEmptySingle();
|
||||
this._defaultMultipleJob = Job.createEmptyMultiple();
|
||||
this._defaultSingleJob = Job.createEmptySingle('deliver_sm');
|
||||
this._defaultMultipleJob = Job.createEmptyMultiple('deliver_sm');
|
||||
|
||||
this.logger = new Logger(`Center-${id}`);
|
||||
|
||||
@@ -218,4 +218,21 @@ export class Center extends SmppSession {
|
||||
this.setStatus(0);
|
||||
}
|
||||
}
|
||||
|
||||
// No reaason for this to be a promise
|
||||
eventAnyPdu(session: any, pdu: any): Promise<any> {
|
||||
this.eventEmitter.emit(this.EVENT.ANY_PDU, pdu);
|
||||
let successful: number = 0;
|
||||
this.pduProcessors.forEach((pduProcessor: PduProcessor) => {
|
||||
pduProcessor.processPdu(session, pdu).then((result: any) => {
|
||||
successful++;
|
||||
}, (error: any) => {
|
||||
});
|
||||
});
|
||||
if (successful === 0) {
|
||||
return Promise.resolve("No PDU processor was able to process the PDU");
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user