*Only close socket when stream is done

This commit is contained in:
Derrick Hammer 2022-08-30 22:42:43 -04:00
parent c750fce402
commit ac8b1d4bf2
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,6 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
if (timer && timer.close) {
clearTimeout(timer as any);
}
socket.end();
const response = unpack(res as any) as RPCResponse;
if (response && response.error) {
this._errors[relay] = response.error;
@ -56,6 +55,7 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
if (response?.data.done) {
this._responses[relay] = {};
resolve(null);
socket.end();
return;
}