Browse Source

Fix IPC broadcast function failing

dev
David Ludwig 4 years ago
parent
commit
86cc33ec6c
2 changed files with 5 additions and 3 deletions
  1. +2
    -2
      packages/ipc/src/AbstractIpcService.ts
  2. +3
    -1
      packages/ipc/src/IpcServerService.ts

+ 2
- 2
packages/ipc/src/AbstractIpcService.ts View File

@ -39,7 +39,7 @@ export default abstract class AbstractIpcService<M extends Microservice = Micros
/** /**
* Boot the IPC service * Boot the IPC service
*/ */
public async boot() {
public override async boot() {
// Create the IPC socket // Create the IPC socket
this.__ipc = new RawIPC.IPC(); this.__ipc = new RawIPC.IPC();
this.__ipc.config.id = this.NAME; this.__ipc.config.id = this.NAME;
@ -51,7 +51,7 @@ export default abstract class AbstractIpcService<M extends Microservice = Micros
/** /**
* Shutdown the IPC service * Shutdown the IPC service
*/ */
public async shutdown() {
public override async shutdown() {
await this.shutdownIpc(this.__ipc); await this.shutdownIpc(this.__ipc);
this.__ipc = null; this.__ipc = null;
} }


+ 3
- 1
packages/ipc/src/IpcServerService.ts View File

@ -86,6 +86,8 @@ export abstract class IpcServerService<M extends Microservice = Microservice> ex
if (this.__server === null) { if (this.__server === null) {
return; return;
} }
this.__server.emit(method, data);
for (let socket of <Socket[]>(<any>this.__server).sockets) {
this.__server.emit(socket, method, data);
}
} }
} }

Loading…
Cancel
Save