This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
socket.remoteAddress after close is undefined #9287
Comments
jameshartig
changed the title
socket.remoteAddress after close
socket.remoteAddress after close is undefined
Feb 26, 2015
I would need to look back through some other issues, but in the past I've advocated for always caching the data, even though it could potentially result in a few more syscalls under the hood, it often leads to easier debugging experiences for everyone. I would definitely entertain a PR that always caches the remote side for both inbound and outbound connections. |
@tjfontaine I just made a PR that hopefully does what you were looking for. It's caching the |
jameshartig
pushed a commit
to jameshartig/node
that referenced
this issue
Mar 10, 2015
Allows socket.remote* properties to still be accessed even after the socket is closed. Fixes nodejs#9287
Closed in 8c38b07 |
cjihrig
pushed a commit
to nodejs/node
that referenced
this issue
Mar 16, 2015
Allows socket.remote* properties to still be accessed even after the socket is closed. Fixes: nodejs/node-v0.x-archive#9287 PR-URL: nodejs/node-v0.x-archive#9366 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
socket.remoteAddress
afterclose
is undefined becausethis._handle
is null. Since we're cachingthis._peername
can we just change_getpeername
to returnthis._peername
if it already exists and not always look for athis._handle
.Related stackoverflow posts:
http://stackoverflow.com/questions/12444598/why-is-socket-remoteaddress-undefined-on-end-event
http://stackoverflow.com/questions/12126403/getting-the-ip-address-of-a-socket-inside-a-close-event-handler
The text was updated successfully, but these errors were encountered: