Skip to content

Commit 426298c

Browse files
darashibnoordhuis
authored andcommitted
docs: dgram client should be closed in the callback
1 parent 74f3904 commit 426298c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

doc/api/dgram.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ Example of sending a UDP packet to a random port on `localhost`;
5353
var dgram = require('dgram');
5454
var message = new Buffer("Some bytes");
5555
var client = dgram.createSocket("udp4");
56-
client.send(message, 0, message.length, 41234, "localhost");
57-
client.close();
56+
client.send(message, 0, message.length, 41234, "localhost", function(err, bytes) {
57+
client.close();
58+
});
5859

5960
**A Note about UDP datagram size**
6061

0 commit comments

Comments
 (0)