-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: fixup socket.remoteAddress #4198
Conversation
@@ -413,7 +413,8 @@ Returns `socket`. | |||
### socket.remoteAddress | |||
|
|||
The string representation of the remote IP address. For example, | |||
`'74.125.127.100'` or `'2001:4860:a005::68'`. | |||
`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if | |||
socket is destroyed (client disconnected, ...). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parenthetical seems confusing more than clarifying. I would say either remove it, or change it to be more explicit: (for example, if the client disconnected)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: if socket is
-> if the socket is
remoteAddress may be undefined under certain conditions Signed-off-by: Arthur Gautier <baloo@gandi.net>
@Trott fixed thanks |
LGTM |
see nodejs/node#4198 test case: ``` javascript var net = require('net'); var server = net.createServer(function(c) { //'connection' listener c.on('end', function() { console.log(c.remoteAddress); server.close(); }); }); server.listen(8124, function() { var client = net.connect({port: 8124}, function(c) { client.end(); }); }); ``` Signed-off-by: Arthur Gautier <baloo@gandi.net>
see nodejs/node#4198 test case: ``` javascript var net = require('net'); var server = net.createServer(function(c) { //'connection' listener c.on('end', function() { console.log(c.remoteAddress); server.close(); }); }); server.listen(8124, function() { var client = net.connect({port: 8124}, function(c) { client.end(); }); }); ``` Signed-off-by: Arthur Gautier <baloo@gandi.net>
LGTM |
remoteAddress may be undefined under certain conditions Signed-off-by: Arthur Gautier <baloo@gandi.net> PR-URL: #4198 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
remoteAddress may be undefined under certain conditions Signed-off-by: Arthur Gautier <baloo@gandi.net> PR-URL: #4198 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
remoteAddress may be undefined under certain conditions Signed-off-by: Arthur Gautier <baloo@gandi.net> PR-URL: #4198 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
remoteAddress may be undefined under certain conditions Signed-off-by: Arthur Gautier <baloo@gandi.net> PR-URL: #4198 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
remoteAddress may be undefined under certain conditions Signed-off-by: Arthur Gautier <baloo@gandi.net> PR-URL: nodejs#4198 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
remoteAddress may be undefined under certain conditions