mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
use pump to pipe sockets
Ensures that destination socket close or destroy also does the same for the source socket.
This commit is contained in:
@@ -46,6 +46,12 @@ describe('ClientManager', () => {
|
||||
const closePromise = new Promise(resolve => socket.once('close', resolve));
|
||||
socket.end();
|
||||
await closePromise;
|
||||
|
||||
// should still have client - grace period has not expired
|
||||
assert(manager.hasClient('foobar'));
|
||||
|
||||
// wait past grace period (1s)
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
assert(!manager.hasClient('foobar'));
|
||||
});
|
||||
}).timeout(5000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user