common: fix socket leak in single client listener

This commit is contained in:
Koushik Dutta
2022-06-17 15:23:39 -07:00
parent 917143fdae
commit 583fda9906

View File

@@ -61,6 +61,7 @@ export async function listenZeroSingleClient() {
const clientPromise = new Promise<net.Socket>((resolve, reject) => {
const timeout = setTimeout(() => {
server.close();
reject(new Error('timeout waiting for client'));
}, 30000)
server.on('connection', client => {