-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dgram: return self on .bind() and .close() #214
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LGTM but can you make the commit log conform to the convention? See CONTRIBUTING.md or |
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`.
brendanashworth
force-pushed
the
dgram-return-self
branch
from
December 29, 2014 21:39
f2207da
to
6a2f4b5
Compare
@bnoordhuis I think its fixed! |
bnoordhuis
pushed a commit
to bnoordhuis/io.js
that referenced
this pull request
Dec 30, 2014
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>
bnoordhuis
pushed a commit
to bnoordhuis/io.js
that referenced
this pull request
Dec 30, 2014
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>
Thanks Brendan, landed in 3e0057d and 4444b7b! |
This was referenced Sep 23, 2021
This was referenced Jan 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I 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.