| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 92f2f19 commit 247dfb7
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -139,7 +139,7 @@ function Socket(type, listener) { | |||
| 139 | 139 | const { signal } = options; | |
| 140 | 140 | validateAbortSignal(signal, 'options.signal'); | |
| 141 | 141 | const onAborted = () => { | |
| 142 | - this.close(); | ||
| 142 | + if (this[kStateSymbol].handle) this.close(); | ||
| 143 | 143 | }; | |
| 144 | 144 | if (signal.aborted) { | |
| 145 | 145 | onAborted(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + require('../common'); | ||
| 3 | + const dgram = require('dgram'); | ||
| 4 | + | ||
| 5 | + const controller = new AbortController(); | ||
| 6 | + const socket = dgram.createSocket({ type: 'udp4', signal: controller.signal }); | ||
| 7 | + | ||
| 8 | + socket.close(); | ||
| 9 | + | ||
| 10 | + controller.abort(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments