Skip to content

Commit 7169436

Browse files
committed
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.
1 parent 924f603 commit 7169436

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/dgram.markdown

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@
66

77
Datagram sockets are available through `require('dgram')`.
88

9+
Important note: the behavior of `dgram.Socket#bind()` has changed in v0.10
10+
and is always asynchronous now. If you have code that looks like this:
11+
12+
var s = dgram.createSocket('udp4');
13+
s.bind(1234);
14+
s.addMembership('224.0.0.114');
15+
16+
You have to change it to this:
17+
18+
var s = dgram.createSocket('udp4');
19+
s.bind(1234, function() {
20+
s.addMembership('224.0.0.114');
21+
});
22+
23+
924
## dgram.createSocket(type, [callback])
1025

1126
* `type` String. Either 'udp4' or 'udp6'

0 commit comments

Comments
 (0)