mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
end socket on timeout
This commit is contained in:
@@ -45,8 +45,8 @@ export class StratumV1Service implements OnModuleInit {
|
|||||||
private startSocketServer() {
|
private startSocketServer() {
|
||||||
const server = new Server(async (socket: Socket) => {
|
const server = new Server(async (socket: Socket) => {
|
||||||
|
|
||||||
//5 min
|
//1 min
|
||||||
socket.setTimeout(1000 * 60 * 5);
|
socket.setTimeout(1000 * 60);
|
||||||
|
|
||||||
const client = new StratumV1Client(
|
const client = new StratumV1Client(
|
||||||
socket,
|
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) => { });
|
socket.on('error', async (error: Error) => { });
|
||||||
|
|
||||||
// //console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}`);
|
// //console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user