From 71694361f97035555a269625f68cfbd06effe58a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 7 Mar 2013 14:13:01 +0100 Subject: [PATCH] doc: dgram: add v0.10 bind() behavior note dgram.Socket#bind() is always asynchronous now. Add a note at the top of the documentation that explains how to upgrade. Fixes #4944. --- doc/api/dgram.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown index bcc3dca..707f348 100644 --- a/doc/api/dgram.markdown +++ b/doc/api/dgram.markdown @@ -6,6 +6,21 @@ Datagram sockets are available through `require('dgram')`. +Important note: the behavior of `dgram.Socket#bind()` has changed in v0.10 +and is always asynchronous now. If you have code that looks like this: + + var s = dgram.createSocket('udp4'); + s.bind(1234); + s.addMembership('224.0.0.114'); + +You have to change it to this: + + var s = dgram.createSocket('udp4'); + s.bind(1234, function() { + s.addMembership('224.0.0.114'); + }); + + ## dgram.createSocket(type, [callback]) * `type` String. Either 'udp4' or 'udp6' -- 2.7.4