(_event: CloseEvent)
| 132 | } |
| 133 | |
| 134 | private onClose(_event: CloseEvent): void { |
| 135 | if (this.inst !== undefined) { |
| 136 | this.globalObjects.forEach(obj => { |
| 137 | obj.dispose(); |
| 138 | }); |
| 139 | this.log(this.inst.runtimeStatsText()); |
| 140 | this.inst.dispose(); |
| 141 | } |
| 142 | if (this.state === RPCServerState.ReceivePacketHeader) { |
| 143 | this.log("Closing the server in clean state"); |
| 144 | this.log("Automatic reconnecting.."); |
| 145 | new RPCServer( |
| 146 | this.url, this.key, this.getImports, this.logger, |
| 147 | this.tensorCacheUrl, this.tensorCacheDevice, |
| 148 | this.initProgressCallback, this.asyncOnServerLoad); |
| 149 | } else { |
| 150 | this.log("Closing the server, final state=" + this.state); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | private onOpen(_event: Event): void { |
| 155 | // Send the headers |
no test coverage detected