| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
LGTM but can you make the commit log conform to the convention? See CONTRIBUTING.md or git log lib/dgram.js for examples. |
Sorry, something went wrong.
This commit changes `lib/dgram.js` Sockets to, when they are bound to a port / IP, return themselves. This is done in order to allow chaining of methods and be in accordance with the `lib/net.js` library.
This commit adds a return statement to the dgram.Socket.close() function that returns itself after it finishes. This follows along the functionality of the more popular and, dare I say, father-library `lib/net.js`.
|
@bnoordhuis I think its fixed! |
Sorry, something went wrong.
This commit changes `lib/dgram.js` Sockets to, when they are bound to a port / IP, return themselves. This is done in order to allow chaining of methods and be in accordance with the `lib/net.js` library. PR-URL: nodejs#214 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit adds a return statement to the dgram.Socket.close() function that returns itself after it finishes. This follows along the functionality of the more popular and, dare I say, father-library `lib/net.js`. PR-URL: nodejs#214 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
These commits add two functionalities to the lib/dgram.js library: a datagram Socket should return itself when it is both closed and bound to a host.
This can be used for better chaining of functions, i.e.:
I ran across this when I was working with the datagram module and chained it like above ^, expecting it to behave like the net module does. These two commits basically make it function like the net module now.
> var net = require('net'); var dgram = require('dgram'); undefined > var server = net.createServer(function() {}); undefined > var socket = dgram.createSocket('udp4'); undefined > server.listen(8124) == server; true > socket.bind(8124) == socket; falseI also added tests, I hope those tests are satisfactory, and should this be merged into io.js I'll send a PR into node.js.