mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-29 03:02:22 +01:00
end socket on timeout
This commit is contained in:
parent
e9a100433a
commit
5c230d132e
@ -45,8 +45,8 @@ export class StratumV1Service implements OnModuleInit {
|
||||
private startSocketServer() {
|
||||
const server = new Server(async (socket: Socket) => {
|
||||
|
||||
//5 min
|
||||
socket.setTimeout(1000 * 60 * 5);
|
||||
//1 min
|
||||
socket.setTimeout(1000 * 60);
|
||||
|
||||
const client = new StratumV1Client(
|
||||
socket,
|
||||
@ -69,6 +69,11 @@ export class StratumV1Service implements OnModuleInit {
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('timeout', () => {
|
||||
console.log('socket timeout');
|
||||
socket.end();
|
||||
});
|
||||
|
||||
socket.on('error', async (error: Error) => { });
|
||||
|
||||
// //console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user