mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
socket cleanup
This commit is contained in:
@@ -561,9 +561,11 @@ export class StratumV1Client {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.error('Error: Cannot write to closed or ended socket.');
|
console.error('Error: Cannot write to closed or ended socket.');
|
||||||
|
this.destroy();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
this.destroy();
|
||||||
if (!this.socket.destroyed && !this.socket.writableEnded) {
|
if (!this.socket.destroyed && !this.socket.writableEnded) {
|
||||||
await this.socket.end();
|
await this.socket.end();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user