File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 22const common = require ( '../common' ) ;
33const assert = require ( 'assert' ) ;
44const dgram = require ( 'dgram' ) ;
5- const socket = dgram . createSocket ( 'udp4' ) ;
6-
7- socket . bind ( 0 ) ;
8- socket . on ( 'listening' , common . mustCall ( ( ) => {
9- const result = socket . setMulticastLoopback ( 16 ) ;
10- assert . strictEqual ( result , 16 ) ;
11- socket . close ( ) ;
12- } ) ) ;
5+
6+ {
7+ const socket = dgram . createSocket ( 'udp4' ) ;
8+
9+ assert . throws ( ( ) => {
10+ socket . setMulticastLoopback ( 16 ) ;
11+ } , / ^ E r r o r : s e t M u l t i c a s t L o o p b a c k E B A D F $ / ) ;
12+ }
13+
14+ {
15+ const socket = dgram . createSocket ( 'udp4' ) ;
16+
17+ socket . bind ( 0 ) ;
18+ socket . on ( 'listening' , common . mustCall ( ( ) => {
19+ assert . strictEqual ( socket . setMulticastLoopback ( 16 ) , 16 ) ;
20+ assert . strictEqual ( socket . setMulticastLoopback ( 0 ) , 0 ) ;
21+ socket . close ( ) ;
22+ } ) ) ;
23+ }
You can’t perform that action at this time.
0 commit comments