Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
doc: dgram: add v0.10 bind() behavior note
Browse files Browse the repository at this point in the history
dgram.Socket#bind() is always asynchronous now. Add a note at the top
of the documentation that explains how to upgrade.

Fixes #4944.
  • Loading branch information
bnoordhuis committed Mar 7, 2013
1 parent 924f603 commit 7169436
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/api/dgram.markdown
Expand Up @@ -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'
Expand Down

0 comments on commit 7169436

Please sign in to comment.