Skip to content

Commit 3ab462e

Browse files
MikhusCopilot
andauthored
Update src/UDPClusterManager.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5867e6f commit 3ab462e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/UDPClusterManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ export class UDPClusterManager extends ClusterManager {
370370
socket.close(() => {
371371
// unref may be missing or not a function on mocked sockets
372372
if (socket && typeof (socket as any).unref === 'function') {
373-
(socket as any).unref();
373+
if (socket && hasUnref(socket)) {
374+
socket.unref();
374375
}
375376

376377
if (

0 commit comments

Comments
 (0)