| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c7257e7 commit b29165f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,14 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 3 | - var dgram = require('dgram'); | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const dgram = require('dgram'); | ||
| 4 | 4 | ||
| 5 | 5 | // should not hang, see #1282 | |
| 6 | 6 | dgram.createSocket('udp4'); | |
| 7 | 7 | dgram.createSocket('udp6'); | |
| 8 | + | ||
| 9 | + { | ||
| 10 | + // Test the case of ref()'ing a socket with no handle. | ||
| 11 | + const s = dgram.createSocket('udp4'); | ||
| 12 | + | ||
| 13 | + s.close(common.mustCall(() => s.ref())); | ||
| 14 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,18 @@ | |||
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | var dgram = require('dgram'); | |
| 4 | 4 | ||
| 5 | - var s = dgram.createSocket('udp4'); | ||
| 6 | - s.bind(); | ||
| 7 | - s.unref(); | ||
| 5 | + { | ||
| 6 | + // Test the case of unref()'ing a socket with a handle. | ||
| 7 | + const s = dgram.createSocket('udp4'); | ||
| 8 | + s.bind(); | ||
| 9 | + s.unref(); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + { | ||
| 13 | + // Test the case of unref()'ing a socket with no handle. | ||
| 14 | + const s = dgram.createSocket('udp4'); | ||
| 15 | + | ||
| 16 | + s.close(common.mustCall(() => s.unref())); | ||
| 17 | + } | ||
| 8 | 18 | ||
| 9 | 19 | setTimeout(common.fail, 1000).unref(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments