From 426298c8c1c0d5b5224ac3658c41e7c2a3fe9377 Mon Sep 17 00:00:00 2001 From: Yoji SHIDARA Date: Thu, 10 Nov 2011 18:10:03 +0900 Subject: [PATCH] docs: dgram client should be closed in the callback --- doc/api/dgram.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown index 6e3f07c..8f48b51 100644 --- a/doc/api/dgram.markdown +++ b/doc/api/dgram.markdown @@ -53,8 +53,9 @@ Example of sending a UDP packet to a random port on `localhost`; var dgram = require('dgram'); var message = new Buffer("Some bytes"); var client = dgram.createSocket("udp4"); - client.send(message, 0, message.length, 41234, "localhost"); - client.close(); + client.send(message, 0, message.length, 41234, "localhost", function(err, bytes) { + client.close(); + }); **A Note about UDP datagram size** -- 2.7.4