(data: string)
| 63 | protected abstract handleData(data: Buffer | string): any; |
| 64 | |
| 65 | protected emitMessage(data: string) { |
| 66 | let message: Record<string, unknown>; |
| 67 | try { |
| 68 | message = JSON.parse(data); |
| 69 | } catch (e) { |
| 70 | throw new InvalidJSONFormatException(e, data); |
| 71 | } |
| 72 | message = message || {}; |
| 73 | this.socket.emit('message', message); |
| 74 | } |
| 75 | } |